-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
74 lines (52 loc) · 3.12 KB
/
README.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
---
output:
rmarkdown::github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
[![minimal R version](https://img.shields.io/badge/R%3E%3D-`r as.character(getRversion())`-brightgreen.svg)](https://cran.r-project.org/)
[![Licence](https://img.shields.io/github/license/mashape/apistatus.svg)](http://choosealicense.com/licenses/mit/)
## Research compendium for alternative COVID-19 mortality analyses
This is a working R compendium (think R package but for reproducible analysis). A good overview on research compendiums, see the [R for Reproducible Research](https://annakrystalli.me/rrresearch/index.html) course.
### Installation
```
git clone https://github.com/bailey-lab/selmar.git
cd selmar
open selmar.Rproj
```
Next, if `renv` has been used in this repository (look out for `renv.lock`) then use `renv::restore` to set up package dependencies. Otherwise `devtools::install_dev_deps()` will install all required packages, as specified in the Imports in DESCRIPTION.
### Overview
The structure within analysis is as follows:
```
analysis/
|
├── 01_xxxxx / # analysis scripts used for generating figures
|
├── figures/ # location of figures produced by the analysis scripts
|
├── data/
│ ├── DO-NOT-EDIT-ANY-FILES-IN-HERE-BY-HAND
│ ├── raw_data/ # data obtained from elsewhere
│ └── derived_data/ # data generated during the analysis
```
### Compendium DOI:
https://doi.org/X/X
The files at the URL above will generate the results as found in the publication.
### The R package
This repository is organized as an R package. There are no/negligable R functions exported in this package - the majority of the R code is in the analysis directory. The R package structure is here to help manage dependencies, to take advantage of continuous integration, and so we can keep file and data management simple. For any R packages that are used frequently in this repository, they are documented in `R/` and are used in the analysis folder using `devtools::load_all()`.
To download the package source as you see it on GitHub, for offline browsing, use this line at the shell prompt (assuming you have Git installed on your computer):
```{r eval=FALSE}
git clone https://github.com/bailey-lab/selmar.git
```
Once the download is complete, open the `selmar.Rproj` in RStudio to begin working with the package and compendium files. We will endeavour to keep all package dependencies required listed in the DESCRIPTION.
<!-- To add this once all the analysis is done -->
In addition we use `renv` to track package dependencies for reproducibility. Please use `renv::restore` to restore the state of the project and see https://rstudio.github.io/renv/articles/renv.html for more information.
### Licenses
Code: [MIT](http://opensource.org/licenses/MIT) year: `r format(Sys.Date(), "%Y")`, copyright holder: OJ Watson
Data: [CC-0](http://creativecommons.org/publicdomain/zero/1.0/) attribution requested in reuse