I need help with that problem. Searching on Google, I've found a way to run the R script without error. It's creating a .bat file with the directorys of Rscript.exe and the script I want to run:
My script is very simple: create a dataframe and save it on a Excel.
library(xlsx)
employee <- c('John Doe','Peter Gynn','Jolie Hope')
salary <- c(21000, 23400, 26800)
startdate <- as.Date(c('2010-11-1','2008-3-25','2007-3-14'))
employ.data <- data.frame(employee, salary, startdate)
write.xlsx(employ.data, 'prueba_r_excel.xlsx')
print('final script')
When I manually run the file, it works without problems and creates the Excel:
But when I put it on task scheduler of windows,
it seems that it does the whole script without problems (it shows the print) but it doesn't create the file for me. Someone knows what could be the problem? Do I have to give some kind of special permission to creat new files from the task scheduler?