pandoc missing when installing rmarkdown
msteijaert opened this issue · comments
Thank you for creating r2u. I recently found out about it and I'm impressed by the speed of the installations and the ease of use.
My first assumption was that all system requirements (including those mentioned in the DESCRIPTION file of the package) would be installed. However, when installing rmarkdown, I noticed that pandoc was not installed. Is this a bug or a deliberate choice?
Example Dockerfile:
FROM rocker/r2u:22.04
RUN R -e "install.packages('rmarkdown')"
RUN R -e "rmarkdown::pandoc_available()"
It is neither a bug nor a choice, it is just how things work. The key to r2u
is that it analyses the dependencies of the R packages, in particular the system-level dependencies that are required to make the (compiled) code of a package work. So no surprises there: when you install, say, RMySQL
it gets you the shared library for the exact version the MySQL-using code was built against.
What you have here is "more loose" and on your end. Yes, rmarkdown
requires pandoc
. But that is also known, and you can add it via sudo apt install pandoc
. Similarly, if you use Markdown to create pdf files you need a complete texlive installation. We do not force that in either.
R's own DESCRIPTION files are an odd compromise. They state the dependendies in a non-machine readable form. And we currently curate no overlay of "packages you likely want along with the package" so if you need pandoc
you just have to install it. We could add such an extra layer of adding (run-time) "Depends" that are "likely" to be needed but have not yet done so. So I think this can be closed.
Thanks @eddelbuettel for the explanation. This makes sense.