I'm trying to create a bat file that will, among other things, create a .pdf report using RStudio at the end of it, I'm currently using this line
R -e "base.path <- 'C:\\temp'; rmarkdown::render('c:\\temp\\report\\report.Rmd')" > C:\temp\log_r.txt 2> C:\temp\log_r_err.txt
Now, if I run this line through the command prompt, it works like a charm, but when I put this line inside a .bat file, I get the error in the title.
I already checked the environment variables, to make sure that RStudio is in the path, but let me know if I'm forgetting something else here.
Edit: the other answers that I found here were unable to solve my problem.