latexdiffr is a small library that uses the latexdiff command to create a diff of two Rmarkdown, .Rnw or TeX files.
You will also need latexdiff installed on your system:
# on MacOS:
brew install latexdiff
# on Linux:
sudo apt install latexdiff
# with tinytex
Rscript -e "tinytex::tlmgr_install('latexdiff')"This produces output like:

git_latexdiff() allows you to compare different revisions of a file in git: