Do you commit RMarkdown output documents to GitHub? What RMarkdown format do you use for work in private GitHub repositories?
In both teaching and research, I tell my students to put their work in a GitHub repo and to use
github_document as the RMarkdown output, and commit both the
.Rmd, source and the
*_files/ output to GitHub. This is convenient in that it allows me to see the results without rendering the
.Rmd locally (which can be slow or fail, particularly on old versions), and gives me a version history on the output so I can dig back for older versions of figures etc if necessary.
However, this is also frustrating in that:
b) it clutters the github repo; outside visitors are probably not aware of the differences between .Rmd and .md versions
c) github_document is not a default or even top-level option in RStudio
HTML-based output have obvious advantages, but do not display on GitHub (for public repos we can use something like htmlpreview.github.com, but not private). I’d be tempted to use Blogdown (as I do for my own research notebook) as a way of keeping the .Rmd input vs output content nicely separated and cleanly presented, but this is a bit heavy and again doesn’t have a viable option for private viewing online.
Other probably-overengineered approaches would be something like having Travis-CI render the .Rmds and push the output to some other private destination where I could view the output independent of the source repos.
Alternately one could simply have students commit .pdf output, but I’m reluctant to encourage committing binary files of things that keep changing. I find this better for the ‘final copy’ document, but maybe should just stick with pdf since at least it renders on GitHub. Other minor improvements would just be any way to have output content wind up in a different directory than input files – I know this is possible with knitr options but in my experience messing with output paths in RMarkdown usually makes things fragile / breakable.
Anyway, would love to hear how others are approaching this.