-
Notifications
You must be signed in to change notification settings - Fork 0
/
prettify.R
83 lines (75 loc) · 1.96 KB
/
prettify.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
prettify_anova = function(raw, cap="title"){
init = raw$ANOVA %>%
select(1:6) %>%
rename(sig=`p<.05`) %>%
mutate(
p = ifelse(p<0.00099, "0.000", p)
) %>%
mutate(
sig=case_when(
p < 0.001 ~ "***",
p < 0.01 ~ "**",
p < 0.05 ~ "*",
TRUE ~ ""
)
)
knitr::kable(init,
row.names=F,
digits = c(0,1,1,2,3,1),
caption=cap) %>%
kable_styling(full_width = F, position='left')
}
# prettify_sphericity = function(raw, cap="title"){
# infile = raw$`Sphericity Corrections` %>%
# mutate(
# `p[GG]` = ifelse(`p[GG]`<.00099, "0.000", `p[GG]`),
# `p[HF]` = ifelse(`p[HF]`<.00099, "0.000", `p[HF]`),
# `p[GG]<.05`= case_when(
# `p[GG]` < 0.001 ~ "***",
# `p[GG]` < 0.01 ~ "**",
# `p[GG]` < 0.05 ~ "*",
# TRUE ~ ""
# ),
# `p[HF]<.05`= case_when(
# `p[HF]` < 0.001 ~ "***",
# `p[HF]` < 0.01 ~ "**",
# `p[HF]` < 0.05 ~ "*",
# TRUE ~ ""
# )
# ) %>%
# rename(
# `sig[GG]` = `p[GG]<.05`,
# `sig[HF]` = `p[HF]<.05`,
# )
#
# knitr::kable(infile,
# row.names = F,
# digits=3,
# caption=cap) %>%
# kable_styling(full_width = F, position='left')
# }
prettify_sphericity = function(raw, cap="title"){
init = raw$ANOVA %>%
select(1:6) %>%
rename(sig=`p<.05`) %>%
mutate(
p = ifelse(p<0.00099, "0.000", p)
) %>%
mutate(
sig=case_when(
p < 0.001 ~ "***",
p < 0.01 ~ "**",
p < 0.05 ~ "*",
TRUE ~ ""
)
)
knitr::kable(init,
row.names=F,
digits = c(0,2,2,2,3,1),
caption=cap) %>%
kable_styling(full_width = F, position='left')
}
prettify_means = function(raw, cap="title"){
kable(raw, digits=2, caption=cap) %>%
kable_styling(full_width = F, position = 'left')
}