My projects are generally structured as R packages with an additional “notebook” folder in which I keep many Rmd’s of my day-to-day explorations. They actually often start out as just Rmd’s until I start moving code out of them Rmd’s into the
R/ folder. However, since the codebase still changes a lot, this means the Rmd’s break as the project continues. It’s not really worth it to update all the Rmd’s as the codebase changes.
I’d like some way to associate a given Rmd with a commit, so I can easily return to the state at which it ran properly. Ideally one would do this so that one could automatically compile one, or all, of the Rmd’s under the state the project was in at their creation.
I thought of putting the SHA in the Rmd’s YAML, but this means an extra commit on top of each (workable but a bit inelegant, not great for clean commit history). If one amends the previous commit with this, it changes the SHA. Another option would be to just come up with a commit message ahead and put this in the YAML, as well. Other thoughts, or suggestions on a different workflow?