It should be obvious why reproducible research (RR) is preferred to non-reproducible research. Googling "reproducible research" should provide all the details. Needless to say, most published research data analyses are very difficult to reproduce and hence the results of these analyses can easily be called into question. A simple remedy is to do all research in a reproducible manner, from the very beginning, the exploratory analyses.
Dynamic report generation and version control can help! Hence, we consider knitr and GitHub below.
- Review of knitr
- knitr examples
- For non-PDFLaTeX output like .html or .docx, try using R Markdown (.Rmd) as it is quite easy to implement
- knitr can be used with LaTeX slides and posters, in the same way as LaTeX documents
- Figures and plots are easy with knitr
- Formatted tables, not so much, but we can work on that
If you have ever ...
- changed your code, then sometime later, wanted to revert back to your old code
- had to develop multiple versions of your code
- wanted to merge one feature into a different version of your code
- lost the code backup you needed
- wanted to test a new feature without messing with your working code
- been distracted by too much commented code that you kept just in case
- been frustrated by the logistics of collaborative writing (either code or documents)
If you have, then version control can help, especially if you code a lot.
Not only is GitHub multiplatform (Linux, Mac, Windows) and open source, but users clone (copy) the entire respository (project), so working offline is easy. Plus, it appears that GitHub is currently (2014) the most popular version control platform (with commits to the cloud), so collaborating with others should be relatively easy with GitHub.
Plus GitHub should handle any text-based file format well, whether that is .R, .tex, .Rnw, .Rmd, .sh, .cpp, .py, etc.
No private repositories are possible with a standard free GitHub account, so please apply for an educational discount after signing in with your University email address. Your account should be upgraded to a free Micro account for the next two years, which means up to 5 private repositories. If 5 private repositories per user is insufficient, then instead of GitHub, we can consider using Bitbucket, which has an "unlimited academic plan".
There are plenty of GitHub tutorials online in both written and video formats. Yes, there is learning curve, but it will save time in the long run.