I am trying to set up a task that runs a batch file that runs a file .rmdthat should knitr me a beautiful .htmlfile every day.
Everything works fine if I run the batch file manually. However, when I run it through the task scheduler, I get the following error from the command line:
Error in file(con, "w") : cannot open the connection
Calls: <Anonymous> -> knit -> writeLines -> file
In addition: Warning message:
In file<con, "w") : cannot open file 'residual_v1.md" : Permission denied
Execution halted
The same user appears as the "author" in the task scheduler, as the user when you open the Start menu.
Batch File Code:
"C:\R\R-3.0.3\bin\x64\Rscript.exe" -e "library(knitr,dplyr); knitr::knit2html('C:/R/Rapporter/residual_model/Residual_v1.Rmd')"
I'm losing what to do.
source
share