library(gt)
library(kableExtra)
## Warning in !is.null(rmarkdown::metadata$output) && rmarkdown::metadata$output
## %in% : 'length(x) = 3 > 1' in coercion to 'logical(1)'
##
## Attaching package: 'kableExtra'
## The following object is masked from 'package:dplyr':
##
## group_rows
df3 <- df2[, c(6,24,27,39:52)] # removed extraneous columns
kable(df3) # clean formatting for table
|
C_Validity
|
C_School
|
C_Role
|
C1_Flexibility
|
C2_Self.efficacy
|
C3_Optimism
|
C4_Self.efficacy
|
C5_Flexibility
|
C6_Optimism
|
C7_Cognitive_focus
|
C8_Optimism
|
C9_Self.efficacy
|
C10_Regulate_emotion
|
C_Total
|
C1C5_Flexibility_Composite
|
C2C4C9_Self.efficacy_Composite
|
C3C6C8_Optimism_Composite
|
|
Y
|
CPN
|
Administrator
|
3
|
3
|
4
|
3
|
3
|
3
|
3
|
4
|
3
|
3
|
32
|
3.0
|
3.000000
|
3.666667
|
|
Y
|
Ashland Elementary
|
Teacher Leader
|
4
|
3
|
2
|
2
|
3
|
3
|
3
|
2
|
3
|
3
|
28
|
3.5
|
2.666667
|
2.333333
|
|
Y
|
Meramec Elementary
|
Teacher
|
4
|
4
|
3
|
3
|
2
|
4
|
3
|
3
|
3
|
3
|
32
|
3.0
|
3.333333
|
3.333333
|
|
Y
|
Ashland Elementary
|
Instructional Coach
|
4
|
4
|
2
|
3
|
3
|
3
|
3
|
4
|
3
|
3
|
32
|
3.5
|
3.333333
|
3.000000
|
|
Y
|
Meramec Elementary
|
Teacher Leader
|
4
|
4
|
3
|
2
|
4
|
4
|
3
|
3
|
3
|
4
|
34
|
4.0
|
3.000000
|
3.333333
|
df4 <- describe(df3)
kable(df4)
|
|
vars
|
n
|
mean
|
sd
|
median
|
trimmed
|
mad
|
min
|
max
|
range
|
skew
|
kurtosis
|
se
|
|
C_Validity*
|
1
|
5
|
1.000000
|
0.0000000
|
1.000000
|
1.000000
|
0.0000
|
1.000000
|
1.000000
|
0.0000000
|
NaN
|
NaN
|
0.0000000
|
|
C_School*
|
2
|
5
|
2.000000
|
1.0000000
|
2.000000
|
2.000000
|
1.4826
|
1.000000
|
3.000000
|
2.0000000
|
0.0000000
|
-2.200000
|
0.4472136
|
|
C_Role*
|
3
|
5
|
2.800000
|
1.3038405
|
3.000000
|
2.800000
|
1.4826
|
1.000000
|
4.000000
|
3.0000000
|
-0.2598658
|
-1.958062
|
0.5830952
|
|
C1_Flexibility
|
4
|
5
|
3.800000
|
0.4472136
|
4.000000
|
3.800000
|
0.0000
|
3.000000
|
4.000000
|
1.0000000
|
-1.0733126
|
-0.920000
|
0.2000000
|
|
C2_Self.efficacy
|
5
|
5
|
3.600000
|
0.5477226
|
4.000000
|
3.600000
|
0.0000
|
3.000000
|
4.000000
|
1.0000000
|
-0.2921187
|
-2.253333
|
0.2449490
|
|
C3_Optimism
|
6
|
5
|
2.800000
|
0.8366600
|
3.000000
|
2.800000
|
1.4826
|
2.000000
|
4.000000
|
2.0000000
|
0.2458756
|
-1.817959
|
0.3741657
|
|
C4_Self.efficacy
|
7
|
5
|
2.600000
|
0.5477226
|
3.000000
|
2.600000
|
0.0000
|
2.000000
|
3.000000
|
1.0000000
|
-0.2921187
|
-2.253333
|
0.2449490
|
|
C5_Flexibility
|
8
|
5
|
3.000000
|
0.7071068
|
3.000000
|
3.000000
|
0.0000
|
2.000000
|
4.000000
|
2.0000000
|
0.0000000
|
-1.400000
|
0.3162278
|
|
C6_Optimism
|
9
|
5
|
3.400000
|
0.5477226
|
3.000000
|
3.400000
|
0.0000
|
3.000000
|
4.000000
|
1.0000000
|
0.2921187
|
-2.253333
|
0.2449490
|
|
C7_Cognitive_focus
|
10
|
5
|
3.000000
|
0.0000000
|
3.000000
|
3.000000
|
0.0000
|
3.000000
|
3.000000
|
0.0000000
|
NaN
|
NaN
|
0.0000000
|
|
C8_Optimism
|
11
|
5
|
3.200000
|
0.8366600
|
3.000000
|
3.200000
|
1.4826
|
2.000000
|
4.000000
|
2.0000000
|
-0.2458756
|
-1.817959
|
0.3741657
|
|
C9_Self.efficacy
|
12
|
5
|
3.000000
|
0.0000000
|
3.000000
|
3.000000
|
0.0000
|
3.000000
|
3.000000
|
0.0000000
|
NaN
|
NaN
|
0.0000000
|
|
C10_Regulate_emotion
|
13
|
5
|
3.200000
|
0.4472136
|
3.000000
|
3.200000
|
0.0000
|
3.000000
|
4.000000
|
1.0000000
|
1.0733126
|
-0.920000
|
0.2000000
|
|
C_Total
|
14
|
5
|
31.600000
|
2.1908902
|
32.000000
|
31.600000
|
0.0000
|
28.000000
|
34.000000
|
6.0000000
|
-0.6207522
|
-1.253333
|
0.9797959
|
|
C1C5_Flexibility_Composite
|
15
|
5
|
3.400000
|
0.4183300
|
3.500000
|
3.400000
|
0.7413
|
3.000000
|
4.000000
|
1.0000000
|
0.2458756
|
-1.817959
|
0.1870829
|
|
C2C4C9_Self.efficacy_Composite
|
16
|
5
|
3.066667
|
0.2788867
|
3.000000
|
3.066667
|
0.4942
|
2.666667
|
3.333333
|
0.6666667
|
-0.2458756
|
-1.817959
|
0.1247219
|
|
C3C6C8_Optimism_Composite
|
17
|
5
|
3.133333
|
0.5055250
|
3.333333
|
3.133333
|
0.4942
|
2.333333
|
3.666667
|
1.3333333
|
-0.5366784
|
-1.487108
|
0.2260777
|
# Source: https://towardsdatascience.com/top-7-packages-for-making-beautiful-tables-in-r-7683d054e541