I need to render forms with rmarkdown from a command line
this is where I am:
rmarkdown::render(file.rmd)
in a .r file works when run in RstudioThen I tried running this command in CMD
c:\Program Files\R\R-4.0.2\bin\Rscript.exe" -e "rmarkdown::render('C:/file.rmd')
and I get this error:
Error: pandoc version 1.12.3 or higher is required and was not found (see the help page ?rmarkdown::pandoc_available).
In RStudio I sent
> rmarkdown::pandoc_available()
[1] TRUE
> rmarkdown::pandoc_version()
[1] ‘2.7.3’
What am I missing here?
By the way, I'm on Win10.
Thanks.
There might be an issue wit h Pandoc version, obviously. But maybe some library requires that older pandoc version, and the issue comes from you using Rmarkdown from outside Rstudio.
This link has the answer
Go into Rstudio and type
Sys.getenv("RSTUDIO_PANDOC")
Now take the output from the command above and put it here
Sys.setenv(RSTUDIO_PANDOC="OUTPUT FROM ABOVE COMMAND")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With