1

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.

Community
  • 1
  • 1
Dmitry Petrov
  • 1,490
  • 1
  • 19
  • 34
  • 1
    Run `locate Rscript` and add the directory where `Rscript` is to your `PATH` variable. Or create a symbolic link of all the files in that directory to your `/usr/local/bin` or `/usr/bin` directories. – Abdou Jul 10 '16 at 21:04
  • I think you should prbly re-install R from C*R*AN. Both `Rscript` and `R` shld be available from the Terminal if they were installed properly. – hrbrmstr Jul 10 '16 at 21:45
  • @Abdou thanks, the idea is correct. I've already found the correct file by find / -name R – Dmitry Petrov Jul 10 '16 at 21:54

1 Answers1

1

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
coatless
  • 20,011
  • 13
  • 69
  • 84
Dmitry Petrov
  • 1,490
  • 1
  • 19
  • 34