Wrapper of knitr::include_graphics to Handle URLs & PDF Outputs
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Those who use knitr::include_graphics()
frequently in their R Markdown files may discover some inconsistencies (from the user point of view) if the same Rmd is used for multiple output formats, especially when PDF (LaTeX) is involved.
The following code works fine for HTML outputs but fails when the outputs are PDFs:
-
knitr::include_graphics('local.gif')
knitr::include_graphics('https://commonmark.org/images/markdown-mark.png')