Dmitry Petrov
Dmitry Petrov

Reputation: 1547

Run R (from pkg) in terminal on OS X

I just installed MacOS version of R from the CRAN web site. Within the R GUI application, everything works fine. However, I'm unable to run it from terminal. Trying to trigger R or Rscript in terminal yields a message indicating that neither command exists.

Also I do not see corresponded scripts in /Applications/R.app/Contents/.

How can I run R from terminal?

PS: I know brew installation will help. But I want this version of R from CRAN web site.

Upvotes: 1

Views: 2066

Answers (1)

Dmitry Petrov
Dmitry Petrov

Reputation: 1547

The R installer creates /Library/Frameworks/R.framework/ directory in addition to /Applications/R.app/.

So, you need add a correct directory to the Library dir. For my packages:

R_APP_DIR=/Library/Frameworks/R.framework/Versions/3.2/Resources/
export PATH=$R_APP_DIR:$PATH

Upvotes: 1

Related Questions