Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aaronpeikert/reproducible-research

A Reproducible Data Analysis Workflow with R Markdown, Git, Make, and Docker
https://github.com/aaronpeikert/reproducible-research

containerization dependency-management literate-programming open-science r reproducibility version-management

Last synced: 3 months ago
JSON representation

A Reproducible Data Analysis Workflow with R Markdown, Git, Make, and Docker

Awesome Lists containing this project

README

        

---
output:
md_document:
variant: gfm
---

```{r setup, include=FALSE}
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[![ORCID iD](https://orcid.org/sites/default/files/images/orcid_16x16.png)](https://orcid.org/0000-0001-7813-818X) and Andreas M. Brandmaier [![ORCID iD](https://orcid.org/sites/default/files/images/orcid_16x16.png)](http://orcid.org/0000-0001-8765-6982).

[![licensebuttons by](https://licensebuttons.net/l/by/3.0/88x31.png)](https://creativecommons.org/licenses/by/4.0) [![Ask Me Anything !](https://img.shields.io/badge/Ask%20me-anything-1abc9c.svg)](https://github.com/aaronpeikert/reproducible-research/issues/new) ![Open Source Love](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)

# Abstract

```{r abstract, child = 'abstract.Rmd'}
```

```{r, echo=FALSE}
knitr::include_graphics("Images/nutshell.svg")
```

# Resources

```{r, include=FALSE}
resources <- read_csv(here("data", "resources.csv"), trim_ws = FALSE)
```

```{r, echo=FALSE, asis=TRUE}
pander(
resources,
split.tables = Inf,
split.cells = Inf,
missing = "",
keep.line.breaks = TRUE,
style = "multiline"
)
```

# Compile

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.

## Standard Way

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`.

## Using a Reproducible Workflow

Does not require R or RStudio, but `make` & `docker`.

Execute in Terminal:

```{bash, eval=FALSE}
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.**

## Rebuild Everything

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`).

```{bash, eval=FALSE}
git pull && make rebuild && make -B DOCKER=TRUE
```

# Session Info

```{r}
sessioninfo::session_info()
```