-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_report.Rmd
253 lines (202 loc) · 7.61 KB
/
generate_report.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
---
title: "Scientific Transparency Report"
subtitle: |
| `r paste(params$ms_title)`
| `r paste('Corresponding author:' , params$ms_author)`
output: pdf_document
classoption: landscape
params:
ms_id: NA
ms_title: NA
ms_author: NA
Q2: NA
Q2a: NA
Q2b_eval: NA
Q2b_input: NA
Q2b_complete: NA
Q2b_partial: NA
Q2b_none: NA
Q2c_input: NA
S2_output: NA
Q3: NA
Q3a: NA
Q3b_eval: NA
Q3b_input: NA
Q3b_complete: NA
Q3b_partial: NA
Q3b_none: NA
Q3c_input: NA
S3_output: NA
Q4: NA
Q4a: NA
Q4b_eval: NA
Q4b_input: NA
Q4b_complete: NA
Q4b_partial: NA
Q4b_none: NA
Q4c_input: NA
S4_output: NA
Q5: NA
Q5_eval: NA
Q5_text: NA
S5_output: NA
Q5_popup: NA
Q6: NA
Q6a: NA
S6_url: NA
S6_output: NA
Q7: NA
Q7a: NA
Q7b: NA
Q7c: NA
S7_url: NA
S7_output: NA
Q7_popup: NA
editor: NA
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, results='asis')
library(pander)
library(tidyverse)
panderOptions('table.continues', '')
panderOptions('table.split.table', Inf)
```
```{r wrangling, include=FALSE}
# data
dataURLs=""
if (!is.null(params$Q2b_input)){ # if access conditions were provided
if (any(!is.na(params$Q2b_input$X6))){ # check whether URL was provided
dataURLs = filter(params$Q2b_input, !is.na(X6))$X6 #params$Q2b_input$X6
}
}
# code
codeURLs=""
if (!is.null(params$Q3b_input)){ # if access conditions were provided
if (any(!is.na(params$Q3b_input$X5))){ # check whether URL was provided
codeURLs = filter(params$Q3b_input, !is.na(X5))$X5 # params$Q3b_input$X5
}
}
# materials
matsURLs=""
if (!is.null(params$Q4b_input)){ # if access conditions were provided
if (any(!is.na(params$Q4b_input$X5))){ # check whether URL was provided
matsURLs = filter(params$Q4b_input, !is.na(X5))$X5 # params$Q4b_input$X5
}
}
# remove pop-up text responses if authors changed their answers
design_text <- shQuote(params$Q5_popup)
if (params$Q5 == "Yes") {
design_text <- ""
}
prereg_text <- shQuote(params$Q7_popup)
if (params$Q7 == "No") {
prereg_text <- ""
}
```
### Data
`r if(params$S2_output == "A"){"The manuscript does not report any data analyses."}`
`r if(params$S2_output == "B"){"In this section authors indicate the access route(s) for all data categories that will be fully shared. All data will be publicly available and no barriers have been reported."}`
`r if(params$S2_output == "C"){"In this section authors indicate the public availability and access route(s) for all selected data categories as well as any barriers for data that cannot be fully shared."}`
`r if(params$S2_output == "D"){"In this section authors explain how readers can access the data that are not publicly available and under what conditions. No data will be publicly available."}`
```{r Q2b}
if (params$Q2b_eval==1 & !is_empty(params$Q2a)) {
Q2b <- params$Q2b_input
names(Q2b) <- c(
"Data category",
"Data type",
"Public availability",
"Availability barrier",
"Public access route",
"URL"
)
#kable(Q2b)
pander(Q2b)
}
```
```{r Q2c}
if (params$Q2b_complete==1 & (params$Q2b_partial==1 | params$Q2b_none==1)) {
Q2c <- params$Q2c_input
names(Q2c) <- c(
"Data category",
"Data type",
"Public availability",
"Restricted access route",
"Restricted access conditions"
)
#kable(Q2c)
pander(Q2c)
}
```
### Analytic Methods (Code)
`r if(params$S3_output == "A"){"The manuscript does not report any data analyses undertaken using code or scripts."}`
`r if(params$S3_output == "B"){"In this section authors indicate the access route(s) for all types of analysis code that will be fully shared. All code will be publicly available and no barriers have been reported."}`
`r if(params$S3_output == "C"){"In this section authors indicate the public availability and access route(s) for all selected analysis code types as well as any barriers for code that cannot be fully shared."}`
`r if(params$S3_output == "D"){"In this section authors explain how readers can access the analysis code that is not publicly available and under what conditions. No code will be publicly available."}`
```{r Q3b}
if (params$Q3b_eval==1 & !is_empty(params$Q3a)) {
Q3b <- params$Q3b_input
names(Q3b) <- c(
"Code type",
"Public availability",
"Availability barrier",
"Public access route",
"URL (if applicable)"
)
#kable(Q3b)
pander(Q3b)
}
```
```{r Q3c}
if (params$Q3b_complete==1 & (params$Q3b_partial==1 | params$Q3b_none==1)) {
Q3c <- params$Q3c_input
names(Q3c) <- c(
"Code type",
"Public availability",
"Restricted access route",
"Restricted access conditions"
)
kable(Q3c)
}
```
### Research Materials
`r if(params$S4_output == "A"){"This research did not make use of any materials to generate or acquire data."}`
`r if(params$S4_output == "B"){"The manuscript only reports analysis of data that already existed prior to the research being undertaken."}`
`r if(params$S4_output == "C"){"In this section authors indicate the access route(s) for all types of research materials that will be fully shared. All materials will be publicly available and no barriers have been reported."}`
`r if(params$S4_output == "D"){"In this section authors indicate the public availability and access route(s) for all selected types of research materials as well as any barriers for materials that cannot be fully shared."}`
`r if(params$S4_output == "E"){"In this section authors explain how readers can access the research materials that are not publicly available and under what conditions. No materials will be publicly available."}`
```{r Q4b}
if (params$Q4b_eval==1 & !is_empty(params$Q4a)) {
Q4b <- params$Q4b_input
names(Q4b) <- c(
"Type of research materials",
"Public availability",
"Availability barrier",
"Public access route",
"URL (if applicable)"
)
kable(Q4b)
}
```
```{r Q4c}
if (params$Q4b_complete==1 & (params$Q4b_partial==1 | params$Q4b_none==1)) {
Q4c <- params$Q4c_input
names(Q4c) <- c(
"Type of research materials",
"Public availability",
"Restricted access route",
"Restricted access conditions"
)
kable(Q4c)
}
```
### Design and Analysis Transparency
`r if(params$Q5 == "Yes"){"This article reports, for all studies, how the author(s) determined all sample sizes, all data exclusions, all data inclusion and exclusion criteria, and whether inclusion and exclusion criteria were established prior to data analysis."}`
`r if(params$Q5 == "No"){"The authors indicated that aspects of the sample size determination, data exclusions, and inclusion or exclusion criteria were not reported in the article. The authors provided the following explanation:"}`
`r if(params$Q5 == "Not Applicable"){"The authors indicated that reporting the sample size determination, data exclusions, and inclusion and exclusion criteria was not applicable to this research. They provided the following justification:"}` `r design_text`
### Preregistration
`r if(params$Q6 == "No"){"The study procedures were not pre-registered."}`
`r if(params$Q6 != "No"){"Study procedures were pre-registered at"}` `r trimws(params$Q6a)`
`r if(params$Q7 == "No"){"The study analysis plans were not pre-registered."}`
`r if(params$Q7 != "No"){"Study analysis plans were pre-registered at"}` `r trimws(params$Q7a)`
`r if(params$S7_output == "C"){"The analyses that were undertaken deviated from the preregistered analysis plans. All such deviations are fully disclosed in the manuscript."}`
`r if(params$S7_output == "D"){"The analyses that were undertaken deviated from the preregistered analysis plans. These deviations are not fully disclosed in the manuscript. The authors provided the following justification:"}` `r prereg_text`