Cannot knit entirely; pandoc error?

Hello everyone,

I'm still quite new to R and Rstudio. Although I did an introductory course at home, where everything worked fine, I cannot get Rmarkdown to work on my work computer.

Knitting doesn't work in any way. Html or PDF doesn't matter. Storing the RMD file on the network or local drive doesn't matter as well. Everytime I'm trying to knit (just the standard document that Rstudio comes up with if you make a new Rmarkdown file), I'm getting the following error: see down below.

Anyone has a fix for this problem? It would be very nice if you'd be able to help. Thank you very much in advance!

processing file: rmarkdownprobeersel.Rmd
|.......... | 14%
ordinary text without R code

|.................... | 29%
label: setup (with options)
List of 1
$ include: logi FALSE

|.............................. | 43%
ordinary text without R code

|........................................ | 57%
label: cars
|.................................................. | 71%
ordinary text without R code

|............................................................ | 86%
label: pressure (with options)
List of 1
$ echo: logi FALSE

|......................................................................| 100%
ordinary text without R code

output file: rmarkdownprobeersel.knit.md

"C:/Users/BTVAND~1/AppData/Local/Pandoc/pandoc" +RTS -K512m -RTS rmarkdownprobeersel.utf8.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash+smart --output rmarkdownprobeersel.html --email-obfuscation none --self-contained --standalone --section-divs --template "\vf-d2-home\d2home$\btvandijk\MyDocs\R\R-3.6.2\library\rmarkdown\rmd\h\default.html" --no-highlight --variable highlightjs=1 --variable "theme:bootstrap" --include-in-header "C:\Users\BTVAND~1\AppData\Local\Temp\Rtmpgr7DMe\rmarkdown-str11c82e0d3787.html" --mathjax --variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --lua-filter "\vf-d2-home/d2home$/btvandijk/MyDocs/R/R-3.6.2/library/rmarkdown/rmd/lua/pagebreak.lua" --lua-filter "\vf-d2-home/d2home$/btvandijk/MyDocs/R/R-3.6.2/library/rmarkdown/rmd/lua/latex-div.lua"
pandoc.exe: \: openBinaryFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 1
Execution halted

The key part of the output is:

which means

  1. pandoc is not installed;
  2. lack of permission to execute it
  3. not in the path

I wish I could be more specific, but I dropped Windows during XT

In fact this error means there is something with the files pandoc tries to open.

Can you explain this type of path "\vf-d2-home\d2home$\btvandijk\MyDocs\R\R-3.6.2\library\rmarkdown\rmd\h\default.html" ?
This is a path to the template pandoc is trying to open from Rmarkdown :package: installed folder (your library). \vf-d2-home\d2home$ seems not like the beginning of a windows path.

Also, which pandoc do you use ?
"C:/Users/BTVAND~1/AppData/Local/Pandoc/pandoc" seems not the one shipped with RStudio. Maybe the version of pandoc could help.

Thank you technocrat en cderv for putting time in helping me. Here is some extra information you requested:

I do have a Pandoc installation, which is version 2.9.1.1 (I think I installed the newest version separately from Rstudio). However, when I try to reach the path

"C:/Users/BTVAND~1/AppData/Local/Pandoc/pandoc"
via windows, there is no folder named 'BTVAN~1'. Actually, my own filder on my local (C:) drive is named 'btvandijk' instead of 'BTVAN~1', so the pandoc.exe file actually is in the following path:
"C:/Users/btvandijk/AppData/Local/Pandoc/pandoc".
Could this be the problem and if yes, how can I direct Rstudio to the right path? Unfortunately I have no permission to just create a new folder in the 'C:/Users' directory

The path that starts with "\vf-d2-home\d2home$\btvandijk" is my folder on the (H:)-drive, or network drive, of the company where I work. Indeed, my R library is in this path. It is a windows 10 computer that I am working on.

This a windows short path. It is normal, windows knows how to expand it. On R you can create those with

https://rdrr.io/r/utils/shortPathName.html

And normalize them with normalizePath

I think the issue can be with the fact that you are working from a network drive. I don’t think pandoc handles this very well. This is discussed here

1 Like

Thank you! Although I'm getting the same error when I run an RMD file from my local C: drive, it then may have something to do with R- and or -Rstudio running from a network drive. I'll get this to my ICT department and see if it can all be changed to my local drive.

Update: Moving everything to the local C: drive fixed the problem. Thank you for your help!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.