-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreproducibility_basic.Rmd
More file actions
160 lines (90 loc) · 2.87 KB
/
Copy pathreproducibility_basic.Rmd
File metadata and controls
160 lines (90 loc) · 2.87 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
---
title: 'Basic reproducibility'
author: 'Francisco Rodríguez-Sánchez'
# date: '@frod_san'
institute: https://frodriguezsanchez.net
output:
binb::metropolis:
keep_tex: no
pandoc_args: ['--lua-filter=hideslide.lua']
fontsize: 12pt
urlcolor: blue
header-includes:
- \definecolor{shadecolor}{RGB}{230,230,230}
# - \setbeamercolor{frametitle}{bg=gray}
---
```{r setup, include=FALSE}
library('knitr')
knitr::opts_chunk$set(echo = FALSE, cache = FALSE, background = 'red',
out.width = '80%',
# out.height = '2in',
fig.align = 'center')
```
## Reproducibility is a gradient
```{r out.width = '4.5in', out.height = '1.7in'}
include_graphics('images/repro_gradient.png')
```
\raggedright
\tiny [Rodríguez-Sánchez et al. 2016](https://www.revistaecosistemas.net/index.php/ecosistemas/article/view/1178) (modif. [Peng 2011](https://doi.org/10.1126/science.1213847))
\raggedleft
# Basic reproducibility
## Basic reproducibility
- **MANUSCRIPT** (Text + Tables + Figures)
- **DATA** in permanent archive (see [Tierney & Ram 2021](https://doi.org/10.1016/j.patter.2021.100368))
- **CODE** in permanent archive (see [Eglen et al 2016](https://doi.org/10.1038/nn.4550))
\vspace{10mm}
\small
*Permanent archive*:
- Zenodo, Dryad, OSF, Figshare, Data Paper...
- NOT GitHub, website...
## How to share data
- **Open** format (csv, txt...)
- **README** (who, what, when, where, why, how)
- **Describe variables**
- **Licence** (CC0, CC-BY, ODbL)
- **Citation** (DOI)
- **Metadata** standardised (JSON, XML)
\raggedright
\tiny [Tierney & Ram 2021](https://doi.org/10.1016/j.patter.2021.100368)
\raggedleft
## Document your data
\footnotesize
```{r echo=TRUE, eval=FALSE}
library('dataspice')
create_spice() # create CSV templates for metadata
edit_creators() # open Shiny apps to edit the CSVs
prep_access()
edit_access()
prep_attributes()
edit_attributes()
edit_biblio()
write_spice() # write machine-readable metadata
build_site() # build human-readable metadata report
```
## How to share code
- Scripts: **plain text** (`.R`)
- **Permanent archive** (eg. Zenodo) with **DOI (citable)**
- [Licence](https://www.software.ac.uk/resources/guides/adopting-open-source-licence)
- **README**
- Computational **environment** (session info)
\raggedright
\tiny [Eglen et al 2016](https://doi.org/10.1038/nn.4550)
\raggedleft
## `sessionInfo` records OS & used packages
\tiny
```{r eval=T}
sessionInfo()
```
## `renv` also records packages used
```{r eval=F, echo=TRUE}
renv::snapshot()
```
creates `renv.lock` file recording dependencies.
Can use `renv::restore()` to restore packages later or in different computer.
## Basic reproducibility
```{r out.width = '60%'}
include_graphics('images/text-data-code.png')
```
DATA + CODE
- analysis fully **traceable**
- results can be **regenerated**