How to set up a reproducible R project

June 3, 2013
By

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

If you're thinking about starting a project (for example, a report or paper) using the R language for analysis, the Nice R code blog has some great advice. Following the principles of reproducible research, Macquarie University postdocs Rich FitzJohn and Daniel Falster suggest:

  • Creating a directory structure to separate R code, data, reports, and output
  • Treating data as read-only files: do data-munging in R code, but always start with the source data
  • Consider output artifcacts (figures and tables) as disposable: the data plus the R script is the canonical source
  • Separate function definitions from the workaday scripts linking them together

They also offer some great advice on setting up a project under these guidelines in RStudio. Follow the link below for complete details and other great tips for a reproducible R-based workflow.

Nice R Blog: Designing projects

To leave a comment for the author, please follow the link and comment on his blog: Revolutions.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.