Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to compare the current commit of an RMarkdown file with the most recent commit. Useful when we merge a pull request and want to check again how it has changed the document
# reviewer pkg comes from https://ropenscilabs.github.io/reviewer/index.html
browseURL(reviewer::diff_rmd("path/to/my-document.Rmd",
# this gets the sha of the previous commit
git2r::commits(n=2)[[2]]$sha)$raw)
# result will open in a web browser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment