Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running an Rscript on Mac OS X

Tags:

macos

r

I have a BATCH File script on a Windows machine that consists of the following line:

c:\R\bin\Rscript.exe "c:\Users\user\Documents\Shares.R" 

I want to do the same thing but using Mac OS X at the moment I am using Automator => Run Shell Script and the following line:

open "/usr/bin/Rscript" "/Users/usr/Documents/Shares.R"

It opens R, finds the file and displays the R code. I want the R code contained in the script to run (like it does in Windows).

Any ideas?

Anthony.

like image 935
Anthony Keane Avatar asked Aug 24 '10 20:08

Anthony Keane


People also ask

How do I run a Rscript in RStudio?

You can open an R script in RStudio by going to File > New File > R script in the menu bar. RStudio will then open a fresh script above your console pane, as shown in Figure 1-7. I strongly encourage you to write and edit all of your R code in a script before you run it in the console.

Can I run R on Macbook Air?

Yes, you can run R on a Mac.


1 Answers

This will be enough :

/usr/bin/Rscript "/Users/usr/Documents/Shares.R"
like image 195
Colin Hebert Avatar answered Sep 18 '22 11:09

Colin Hebert