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?

Russia Must Remove Putin
  • 374,368
  • 89
  • 403
  • 331
Giovanni Soldi
  • 385
  • 1
  • 4
  • 12

1 Answers1

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.

userABC123
  • 1,460
  • 2
  • 18
  • 31
  • 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: http://stackoverflow.com/questions/38534383/how-to-set-up-conda-installed-r-for-use-with-rstudio – O.rka Jul 26 '16 at 04: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 Jul 27 '16 at 01: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 Jul 27 '16 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 Aug 24 '19 at 18:56