|Step 3: The Run Shell Script Action|
- Test your R script in regular ole' R to make sure it runs without error.
- Add a quit(save="no") command at the end of your script.
- Open Automator (Applications -> Automator)
- Select Application from the Template Selection menu
- Select the Run Shell Script Action, double click or drag it over
- Type: Rscript --no-save --no-restore /Users..../YourScript.R
- The last argument should be the path of the script file you want to run
- The 2nd and 3rd arguments tell R not to save the workspace when it's done and not to restore previously saved objects on startup, respectively
- To see a full list of arguments you can pass to Rscript, just open Terminal and type Rscript