How to set up a reproducible R project

June 3, 2013

(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 their blog: Revolutions. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, 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.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)