Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rmarkdown: specify manually pandoc path?

I have a rmarkdown document that I render regularly with rmarkdown::render

It works fine on my computer (Windows) as I have RStudio installed, and it has setup automatically the path to pandoc.

However when I try to run it on my server (outside RStudio), it fails with error that pandoc is not found.

How can I set up manually the path the pandoc from my script? Without changing the configuration on the server.

I have tried this but it doesn't work:

Sys.setenv(RSTUDIO_PANDOC="PATH_TO_MY_PANDOC_BIN/binaries/pandoc/pandoc.exe")
like image 579
RockScience Avatar asked Nov 18 '16 08:11

RockScience


1 Answers

I suggest to set the system path for pandoc (Windows 10 instructions):
1. In the Start menu, search for "Edit the system environment variables"
2. At this point, Windows may ask you for username + password (for a user with permission to change system settings)
3. Click "Environment Variables" button
4. In the lower part of the window (System variables), select the line with "Path" and click Edit
5. Add the path to the folder where pandoc.exe is, but not including "pandoc.exe" or a slash at the end

like image 87
Dag Hjermann Avatar answered Oct 27 '22 12:10

Dag Hjermann