There are four pillars of reproducible projects:
-
Version Control
Version Control is essential, but squeezing it into this 2h workshop would be fruitless. Mastering Git is left as an exercise for the reader. The open (meaning free) book Happy Git and GitHub for the useR is excellent. -
Dynamic Documents
We will learn the absolute minimal subset of RMarkdown. I don't miss you Microsoft © Word. Did you know that R Markdown: The Definitive Guide is written in RMarkdown? -
External Dependencies
"I love packages" is written on the entry to dependency hell. We will userenv
to keep track of our packages and their version. If you want to learn more, readvignette("renv", package = "renv")
Because I am a control freak, I like to add Docker to the mix to control everything from the R version down to the operating system (left as an exercise to the reader). Affiliate Link. -
Internal Dependencies
The answer to "How do I reproduce this?" should fit into a tweet. Asking yourself too often if the results for the manuscript are up to date will drive you crazy.targets
will help us to keep our sh*t together. Anyone venturing beyond the limits of R, using Python, Julia or Matlab might want to look into Make (left as an exercise to the reader). Affiliate Link.
Copy: https://github.com/aaronpeikert/ecr2020
Visit: https://rstudio.cloud
Copy:
install.packages(c("ggplot2", "rmarkdown", "renv", "remotes", "visNetwork", "Rcpp", "git2r"))