11

I have installed anaconda and the conda package R on my mac os x yosemite. When I type

which R

in my terminal, I get the following output

/Users/giovannisoldi/anaconda/bin/R

so it is actually linking to the right version. However, when I open RStudio, I can see that the old version of R located in

/Library/Frameworks/R.framework/Versions/2.15/

is still used. I tried to link to the current version of R in Anaconda, with the following command:

ln -sfhv /Users/giovannisoldi/anaconda/bin/ /Library/Frameworks/R.framework/Versions/Current

However, by doing this RStudio complains that it can't locate R.

Is there a way to solve this issue?

3
  • 2
    In RStudio, from the menu: Tools -> Global options... Then set the R version
    – Ven Yao
    Commented Jan 13, 2016 at 11:54
  • support.rstudio.com/hc/en-us/articles/…
    – user3710546
    Commented Jan 13, 2016 at 12:10
  • This doesn't work because RStudio will not start if it cannot find your version of R. Commented Mar 27, 2016 at 14:10

1 Answer 1

7

Here's how I did it:

which R
/Users/admin/anaconda/bin/R

In my ~/.bashrc (or your ~/.bash_profile) I put this:

export RSTUDIO_WHICH_R=/Users/admin/anaconda/bin/R 

Then source ~/.bashrc

(you now have to open RStudio from the terminal) finally, you can type

rstudio

or you can, again, edit your ~/.bashrc with alias rstudio='open -a RStudio .' and now the rstudio command will open RStudio in your current dir.

4
  • no O__o . This method you made makes perfect sense. I don't know how to get it to work tho. I've tried to describe my situation in as much detail as possible here: stackoverflow.com/questions/38534383/…
    – O.rka
    Commented Jul 26, 2016 at 4:39
  • @O.rka, ohh okay. I'll spend some time on that since I've had issues like that on other computers / OSes, so it'd be good for me too
    – userABC123
    Commented Jul 27, 2016 at 1:19
  • I'll be on my computer a bit today so let me know if there's any commands you want me to run to get some more specs. Thanks a lot @sndean
    – O.rka
    Commented Jul 27, 2016 at 16:07
  • 1
    On elementary OS, I put export RSTUDIO_WHICH_R=/home/user/miniconda3/envs/R/lib/R/bin/R into ~/.profile and it works.
    – der_grund
    Commented Aug 24, 2019 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.