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
I just wrote a post a week ago that extends on this some. Mostly how to get the data to others and how they can refresh the data and see if your results still hold.
http://randomlydistributedthoughts.blogspot.com/2013/05/reproduacability-made-easy-body-td-font.html
Posted by: Kenny | June 03, 2013 at 18:43