Last active
February 22, 2023 20:43
-
-
Save benmarwick/3eb501c181c8fea6968e531a09d651e8 to your computer and use it in GitHub Desktop.
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reviewer pkg comes from https://ropenscilabs.github.io/reviewer/index.html | |
# remotes::install_github("ropenscilabs/reviewer") | |
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