I need to render forms with rmarkdown from a command line
this is where I am:
- knit button in RStudio works fine
- function
rmarkdown::render(file.rmd)
in a .r file works when run in Rstudio
Then 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.
Sys.setenv(RSTUDIO_PANDOC="C:/Program Files/RStudio/bin/pandoc") rmarkdown::render(input = "file.rmd")
Now with the CMD I just call this script and it works fine, thanks a lot ! – Lathy