A Reproducible Data Analysis Workflow with R Markdown, Git, Make, and Docker
CC-BY-4.0 License
knitr::opts_chunk$set(echo = TRUE)
library(here)
library(readr)
library(pander)
This is the accompanying GitHub repository to a work in progress paper by Aaron Peikert and Andreas M. Brandmaier .
knitr::include_graphics("Images/nutshell.svg")
resources <- read_csv(here("data", "resources.csv"), trim_ws = FALSE)
pander(
resources,
split.tables = Inf,
split.cells = Inf,
missing = "",
keep.line.breaks = TRUE,
style = "multiline"
)
The following paragraphs describe how you can obtain a copy of the source files of our manuscript describing reproducible workflows, and create the PDF. Either, you can go the 'standard' way of downloading a local copy of the repository and knit the manuscript file in R, or you can use the reproducible workflow as suggested and use Make to create a container and build the final PDF file in exactly the same virtual computational environment that we used to render the PDF.
Requires: Git
, RStudio
, pandoc
, pandoc-citeproc
& rmarkdown
.
Open RStudio -> File -> New Project -> Version Control -> Git
Insert:
https://github.com/aaronpeikert/reproducible-research.git
Open manuscript.Rmd
click on Knit
.
Does not require R or RStudio, but make
& docker
.
Execute in Terminal:
git clone https://github.com/aaronpeikert/reproducible-research.git
cd reproducible-research
make build
make all DOCKER=TRUE
Note: Windows user need to manually edit the Makefile
and set current_path to the current directory and use make all DOCKER=TRUE WINDOWS=TRUE
. We hope that future releases of Docker for Windows will not require that workaround.
In case you experience some unexpected behavior with this workflow, you should check that you have the most recent version (git pull
), rebuild the docker image (make build
) and force the rebuild of all targets (make -B DOCKER
).
git pull && make rebuild && make -B DOCKER=TRUE
sessioninfo::session_info()