-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path09-AB_tDCS_supplement.Rmd
82 lines (69 loc) · 3.17 KB
/
09-AB_tDCS_supplement.Rmd
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
```{r setup, include=FALSE}
#Setup
library(kableExtra) # complex tables
library(tidyverse) # importing, transforming, and visualizing data frames
knitr::opts_chunk$set(results = 'hide', echo = FALSE, message = FALSE, warning = FALSE)
# create variable to resize figures/text depending on output
if (knitr::is_latex_output()) {
tbl_font_size <- 8
line_break <- function(...) {kableExtra::linebreak(...)}
} else {
tbl_font_size <- 12
# use html version of linebreak function
line_break <- function(x, ...) {
if (is.numeric(x) | is.logical(x)) return(x)
ifelse(stringr::str_detect(x, "\n"), stringr::str_replace_all(x, "\n", "<br />"), x)
}
}
# load data objects
load("AB_tDCS_files/AB_tDCS_supplement.RData")
```
`r if (knitr::is_html_output()) '
# Supplement to Chapters 4 and 5 {#AB-tDCS-supplement}
' else '
# Supplement to Chapters \\@ref(AB-tDCS-EEG) and \\@ref(AB-tDCS-sEBR) {#AB-tDCS-supplement}
'`
## tDCS adverse effects
```{=latex}
\begingroup
\renewcommand*{\arraystretch}{1.25}
\setlength{\LTleft}{-20cm plus -1fill}
\setlength{\LTright}{\LTleft}
```
```{r tab-AB-tDCS-AE, results='asis'}
if (knitr::is_latex_output() | knitr::is_html_output()) {
ae_colnames <- c(" ",
"none", "a\nlittle", "mode-\nrate", "strong", "very\nstrong",
"n/a", "un-\nlikely", "possi-\nbly", "likely", "very\nlikely")
bind_rows(full_join(tbl_int_anodal, tbl_conf_anodal, by = "sensation"),
full_join(tbl_int_cathodal, tbl_conf_cathodal, by = "sensation")) %>%
kable(col.names = line_break(ae_colnames, align = "c"),
booktabs = TRUE,
longtable = TRUE,
escape = FALSE,
caption = "Number of reports of tDCS adverse effects") %>%
kable_styling(bootstrap_options = "striped",
font_size = tbl_font_size) %>%
add_header_above(setNames(c(1,5,5), c(" ",
paste0("Intensity rating", footnote_marker_alphabet(1, double_escape = TRUE)),
paste0("Confidence rating", footnote_marker_alphabet(2, double_escape = TRUE)))),
escape = FALSE) %>%
pack_rows(index = c("anodal session" = 8, "cathodal session" = 8)) %>%
footnote(alphabet = c(
'"To which degree were the following sensations present during stimulation?"',
'"To which degree do you believe this was caused by the stimulation?"'))
}
```
\endgroup
\newpage
\pagestyle{empty}
\changetext{}{}{-25mm}{}{}
\blandscape
```{r fig-AB-tDCS-AE, fig.cap='(ref:caption-fig-AB-tDCS-AE)', results='show'}
knitr::include_graphics("AB_tDCS_files/figures/figure_S1_AE.png", auto_pdf = TRUE)
```
(ref:caption-fig-AB-tDCS-AE) __tDCS adverse effects in Chapters \@ref(AB-tDCS-EEG) and \@ref(AB-tDCS-sEBR)__. Number of reports out of 89 sessions (either anodal or cathodal tDCS). Top row shows intensity ratings [_little, moderate, strong, very strong_]; bottom row shows participant's confidence that event was related to tDCS [_unlikely, possibly, likely, very likely_]. Adverse effects are sorted in descending order of number of reports (for very rare events (five reports or fewer for a given polarity), some text counts have been removed to prevent overlap).
\newpage
\elandscape
\changetext{}{}{+25mm}{}{}
\pagestyle{\defstyle}