-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReproducibleScience_parent.Rmd
More file actions
235 lines (135 loc) · 4.2 KB
/
Copy pathReproducibleScience_parent.Rmd
File metadata and controls
235 lines (135 loc) · 4.2 KB
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
---
title: Reproducible Workflows \newline for Better Science and Efficient Collaboration
# subtitle: ""
author: "Francisco Rodriguez-Sanchez"
institute: "https://frodriguezsanchez.net"
# date: "@frod_san"
aspectratio: 43 # 169
fontsize: 11pt
output:
binb::metropolis:
keep_tex: no
pandoc_args: ["--lua-filter=hideslide.lua"]
urlcolor: blue
linkcolor: blue
header-includes:
- \definecolor{shadecolor}{RGB}{230,230,230}
- \setbeamercolor{frametitle}{bg=gray}
---
```{r include=FALSE, cache=FALSE}
options(knitr.duplicate.label = "allow")
library("knitr")
### Chunk options ###
## Text results
# opts_chunk$set(eval = TRUE, warning = FALSE, message = FALSE, size = 'tiny')
#
# opts_template$set(fig = list(echo = FALSE, eval = TRUE))
#
# ## Code decoration
# opts_chunk$set(tidy = FALSE, comment = NA, highlight = TRUE, prompt = FALSE, crop = TRUE)
# ## Cache
# opts_chunk$set(cache = TRUE, cache.path = "knitr_output/cache/")
# ## Plots
# opts_chunk$set(fig.path = "knitr_output/figures/")
# opts_chunk$set(fig.align = 'center', out.width = '80%')
### Hooks ###
## Crop plot margins
knit_hooks$set(crop = hook_pdfcrop)
## Reduce font size
## use tinycode = TRUE as chunk option to reduce code font size
# see http://stackoverflow.com/a/39961605
knit_hooks$set(tinycode = function(before, options, envir) {
if (before) return(paste0("\n \\", options$size, "\n\n"))
else return("\n\n \\normalsize \n")
})
```
## Outline
\Large
- WHAT is (computational) reproducibility?
- WHY is it important?
- HOW can we do reproducible research?
# The Reproducibility Crisis/Revolution
```{r child="repro_crisis.Rmd"}
```
# Why doing reproducible research?
```{r child="why_repro.Rmd"}
```
# How to do reproducible research
```{r child="reproducibility_basic.Rmd"}
```
# Version control
---
```{r }
include_graphics("images/vcontrol-phdcomic.png")
```
## Version control with `git`
```{r out.width = '3.5in', out.height = '1.7in'}
include_graphics("images/git.png")
```
\raggedright
\tiny [R. Fitzjohn](https://github.com/richfitz/reproducibility-2014)
\raggedleft
## Much to learn from software engineering
```{r out.width="60%", fig.align='left'}
include_graphics("images/Ram-title.png")
```
```{r out.width="90%"}
include_graphics("images/git-Ram.jpg")
```
\raggedright
\tiny [Ram 2013](https://doi.org/10.1186/1751-0473-8-7)
\raggedleft
## Automatic checks with Continuous Integration
```{r out.width="50%", fig.align='left'}
include_graphics("images/ci-paper.png")
```
```{r out.width = '3.5in', out.height = '2.7in'}
include_graphics("images/travis.PNG")
```
# Structuring projects
```{r child="project_structure.Rmd"}
```
# Research compendia: projects as packages
```{r child="research_compendia.Rmd", eval=TRUE}
```
# Data management
```{r child="data_management.Rmd", eval=TRUE}
```
# Tidy data
```{r child="tidy_data.Rmd", eval=TRUE}
```
# Reproducible dynamic documents with Rmarkdown
```{r child="Rmarkdown.Rmd", eval=TRUE}
```
# Workflow management
```{r child="workflow-management.Rmd", eval=TRUE}
```
# Controlling software dependencies
```{r child="dependencies.Rmd", eval=TRUE}
```
## How to write more reproducible code
- [Building reproducible analytical pipelines with R](https://raps-with-r.dev/)
- [BES guide to reproducible code](https://www.britishecologicalsociety.org/wp-content/uploads/2019/06/BES-Guide-Reproducible-Code-2019.pdf)
- [Turing Way](https://the-turing-way.netlify.app)
- [Good enough practices in scientific computing](https://doi.org/10.1371/journal.pcbi.1005510)
- [Ciencia reproducible: qué, por qué, cómo](https://doi.org/10.7818/ECOS.2016.25-2.11)
- https://rstats.wtf
- [`fertile`](https://github.com/baumer-lab/fertile) package
- [CodeCheck](https://codecheck.org.uk)
## Reproducibility
- Good for you, good for science
- Requires systemic changes
- Reproducibility gradient: step by step
```{r out.width = '80%', echo=FALSE, eval=TRUE}
include_graphics("images/repro_gradient.png")
```
---
\LARGE
Happy collaboration!
```{r out.width="50%", echo=F, eval=TRUE}
knitr::include_graphics("images/happy-collab.jpg")
```
\vspace{5mm}
```{r out.width="10%", echo=F, eval=T, fig.align='right'}
knitr::include_graphics("images/cc-by-nc-sa.png")
```