Reputation: 21
I'm having problems knitting an .rmd file to a .html (and pdf for that matter) file using rmarkdown. The report that I'm trying to knit in the following example is just the example report you get when starting a new rmakrdown document.
This is the error message I get:
==> rmarkdown::render('C:/Users/***/Documents/test/test.Rmd', encoding = 'UTF-8');
processing file: test.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: test.knit.md
"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS test.utf8.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output test.html --email-obfuscation none --self-contained --standalone --section-divs --template "\\storage-***.se\home$\****\My Documents\R\win-library\4.0\rmarkdown\rmd\h\default.html" --no-highlight --variable highlightjs=1 --variable "theme:bootstrap" --include-in-header "C:\Users\*****\AppData\Local\Temp\Rtmpc1mrLs\rmarkdown-str511010115ff7.html" --mathjax --variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --lua-filter "\\storage-****.se/home$/****/My Documents/R/win-library/4.0/rmarkdown/rmd/lua/pagebreak.lua" --lua-filter "\\storage-***-se/home$/*****/My Documents/R/win-library/4.0/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
Pandoc tries to reach a file saved on my computer but for some reason can't find it. This is my work computer where everything is saved locally and then uploaded to a server. I have talked with IT at my office and they don't know why it wont work. I have managed to get a rmarkdown report before when I moved EVERYTHING (r project, packages and the files where I do my analysis) to a map that is not uploaded to the backup server. However, this is not a safe way since there is no backup, obviously. I've tried to just have the r-project locally for the knitting but it doesn't work either. Why can't pandoc find this binary file and is there a way I can get it to work without having to risk the safety of my work? If not, is there another way of creating similar files without pandoc?
I have seen similar questions but nothing that could give me any answers. Or give the people at the IT department any clues.
Thanks! Johanna
Here is the session information:
> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)
Matrix products: default
locale:
[1] LC_COLLATE=Swedish_Sweden.1252 LC_CTYPE=Swedish_Sweden.1252
[3] LC_MONETARY=Swedish_Sweden.1252 LC_NUMERIC=C
[5] LC_TIME=Swedish_Sweden.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.0.2 htmltools_0.5.0 tools_4.0.2 yaml_2.2.1 rmarkdown_2.3
[6] knitr_1.29 xfun_0.16 digest_0.6.25 rlang_0.4.7 evaluate_0.14
Versions:
> version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 4
minor 0.2
year 2020
month 06
day 22
svn rev 78730
language R
version.string R version 4.0.2 (2020-06-22)
nickname Taking Off Again
> pandoc_version()
[1] ‘2.7.2’
> pandoc_available()
[1] TRUE
Upvotes: 0
Views: 8210
Reputation: 21
I have solved the problem!
The actual problem was the path of the rmarkdown
package. It was on my //storage
... path. What I finally had to do was to go into system settings and add an environmental variable for R_LIBS_USER
to my H:/
path. Now when pandoc
is looking for the rmarkdown
details it can find the path.
Upvotes: 2
Reputation: 3242
Using this link as research. try using the RELATIVE path for your file. in this one you are using the absolute path C:/Users/... and this temporarily changes R's working directory.
Upvotes: 0