1

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.

Phil
  • 7,287
  • 3
  • 36
  • 66
  • This isn't related to `R`. It seems like your shell doesn't know how to execute `schtasks`, you are probably missing it. I'm not an expert on Mac OS though, so can't really say what to install – GGamba Feb 08 '17 at 15:13
  • @G Gamba I tried to remedy this by referring to this [link](https://kmyu.wordpress.com/2011/01/29/binsh-latex-command-not-found-setting-r-path-to-include-tex-binaries-path/). However, I don't understand as to what you mean by "It seems like your shell doesn't know how to execute schtasks". Please clarify if possible. Thank You. – Anubhav Shankar Feb 08 '17 at 15:41
  • Open a **shell** console and type `schtasks` – GGamba Feb 08 '17 at 15:43
  • @GGamba I ran the following on terminal:Udays-MacBook-Pro:~ udayshankar$ schtasks and afterwards got the following output: -bash: schtasks: command not found. – Anubhav Shankar Feb 08 '17 at 16:25

0 Answers0