Error in system(cmd, intern = TRUE) : error in running command

3.8k Views Asked by At

I am running the following codes to create a scheduled scraping of tweets from Twitter using the "taskscheduleR" package on R Studio:

a <- file.path("/Users/udayshankar/Desktop/UPElectionsRfiles/upelections.R") 
taskscheduler_create(taskname = "upelection1",rscript = a,schedule = "ONCE",starttime = "22:11",startdate = format(Sys.Date(),"%d/%m/%Y"))

In the vector a I have created the path to save the scraped Twitter data into the following file upelections.R and saved it into my working directory mentioned in the file.path() command.

However, after executing the second command, I get the following error:

Error in system(cmd, intern = TRUE) : error in running command sh: schtasks: command not found

Please help me troubleshoot the above problem. I have even installed the required X11 package as I am running this on Mac OS X Sierra. I also seem to be unable to access the physical library of R on Mac.

0

There are 0 best solutions below