0

Probably a very basic question for someone who knows what they're doing.

I installed anaconda and jupyter notebooks, and now which R returns /opt/anaconda3/bin/R, rather than /usr/local/bin/R as it did before.

How do I change this back so that RStudio uses /usr/local/bin/R, but preferably without deleting files, editing PATH environment variable, or moving files/binaries around (I am open to suggestion, but prefer a 'best practice' so that anaconda/notebooks work if I need them).

stevec
  • 41,291
  • 27
  • 223
  • 311
  • Did you try `export RSTUDIO_WHICH_R=/usr/local/bin/R`? See https://support.rstudio.com/hc/en-us/articles/200486138-Changing-R-versions-for-RStudio-desktop. – Ritchie Sacramento Apr 09 '20 at 04:41
  • @H1 I quick fixed it by removing the anaconda R binaries with `rm $(which R)` and `rm $(which rscript)`, then [uninstalling regular R entirely](https://stackoverflow.com/a/24981651/5783745) and RStudio entirely, then reinstalled R + RStudio. Amateur fix. It worked, but the anaconda version obviously won't work anymore. I will definitely try `export` when I can, I have bookmarked the link you provide, looks like excellent reading (I wasn't even aware of the order in which RStudio scans for R until seeing it there) - thanks very much for the knowledge – stevec Apr 09 '20 at 10:07

0 Answers0