title: Error in system(cmd, intern = TRUE) : error in running command
body: <p>I am running the following codes to create a scheduled scraping of tweets from Twitter using the "taskscheduleR" package on R Studio:</p>
  
  <pre><code>a &lt;- 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"))
  </code></pre>
  
  <p>In the vector <code>a</code> I have created the path to save the scraped Twitter data into the following file <code>upelections.R</code> and saved it into my working directory mentioned in the <code>file.path()</code> command. </p>
  
  <p>However, after executing the second command, I get the following error:</p>
  
  <blockquote>
    <p>Error in system(cmd, intern = TRUE) : error in running command sh:
    schtasks: command not found</p>
  </blockquote>
  
  <p>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.</p>