A.3 Linux
This guide assumes you have already installed R and the RStudio IDE. As with Windows and Mac, RStudio is not required but is recommended. If you don’t have RStudio installed you will also need to install Pandoc using your OS package manager, but if you do have RStudio then there’s no need as Pandoc is bundled with it. You can then install the rmarkdown package in the usual way:
The dep = TRUE argument will also install a bunch of additional R packages on which rmarkdown depends.
If you want to generate PDF output you will need a LaTeX distribution. Most Linux distributions offer TeX Live through their package manager, but a full TeX Live installation is a very large download indeed and you almost certainly don’t need all of it. We suggest you install TinyTeX from within R instead:
TinyTeX is a lightweight, portable, cross-platform, and easy-to-maintain LaTeX distribution. The R companion package tinytex can help you automatically install missing LaTeX packages when compiling LaTeX or R Markdown documents to PDF. If you already have a working TeX Live installation on your machine then there’s no need to install TinyTeX as well.
With the rmarkdown package, RStudio/Pandoc, and LaTeX, you should be able to compile most R Markdown documents.