开发者

Running an Rscript on Mac OS X

开发者 https://www.devze.com 2023-01-13 12:39 出处:网络
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 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?

Anthon开发者_如何转开发y.


This will be enough :

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


On windows:

C:\Program Files\R\R-3.x.x\bin\Rscript.exe 

On Linux:

rwrapper.executable=/usr/lib/R/bin/Rscript

On Mac:

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

精彩评论

暂无评论...
验证码 换一张
取 消