rmarkdown: specify manually pandoc path?

我的梦境 提交于 2019-12-10 13:29:41

问题


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")

回答1:


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



来源:https://stackoverflow.com/questions/40672864/rmarkdown-specify-manually-pandoc-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!