title: How to run RScript using crontab in Mac OSX
body: <p>I have searched around on how to do this on here and none have really solved my problem. Partially because i do not understand what is going on....unfortunately</p>
  
  <p>I have an Rscript I am trying to schedule to run every day called: <code>JASON.r</code></p>
  
  <p>the code inside the script is the following:</p>
  
  <pre><code>setwd("/Volumes/3TB/")
  install.packages("quantmod");library("quantmod")
  getSymbols("AAPL")
  write.csv(AAPL,"/Volumes/3TB/AAPL.csv")
  quit(save='no')
  </code></pre>
  
  <p>I have found <a href="https://tgmstat.wordpress.com/2013/09/11/schedule-rscript-with-cron/" rel="nofollow noreferrer">THIS PAGE</a> on how to do so, but i have been not been successful.
  What I do is open terminal and type:</p>
  
  <p><code>Jason-Guevaras-iMac:~ rimeallthetime$ sudo crontab -e</code></p>
  
  <p>for which it returns the following:</p>
  
  <pre><code>crontab: no crontab for root - using an empty one
  
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  "/tmp/crontab.fwiSAwWI4R" 0L, 0C
  </code></pre>
  
  <p>So then I came across <a href="https://superuser.com/questions/201172/mac-crontab-is-never-created">THIS POST</a> which had similar issues and when I type:</p>
  
  <pre><code>Jason-Guevaras-iMac:~ rimeallthetime$ sudo su -
  Jason-Guevaras-iMac:~ root# crontab -u rimeallthetime -e
  crontab: no crontab for rimeallthetime - using an empty one
  
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  ~                                                                               
  "/tmp/crontab.L1nPwJdBRi" 0L, 0C
  </code></pre>
  
  <p>That is where I am at currently....</p>
  
  <p>I have MAC OSX El Capitan version 10.11.4</p>