0

I just installed the anaconda environment to use Python. Now, within Python, I would like to make use of the rpy2 package. When running

conda install rpy2

conda suggests to install R along with some base packages. I suppose this will install R into the anaconda-environment.

Is there any danger of breaking my "normal" R installation by doing this, or can they co-exist, or is there anything I need to pay attention to?

How do I install specific R packages within the anaconda installation? Can I just follow this answer?

All this is in Ubuntu 16.04 if that matters.

user3825755
  • 883
  • 2
  • 10
  • 29

2 Answers2

0

You can install R and rpy2 from the Anaconda Navigator.

PaW
  • 659
  • 4
  • 7
  • What woudl be the advantage of using the navigator, won't this have the same effects as installing it using conda and the default settings? – user3825755 Feb 08 '18 at 10:59
  • You're right. However, when you install RStudio from the navigator, it automatically installs all the required packages. I found it much easier to install it from there, hence the suggestion. – PaW Feb 08 '18 at 11:02
0

Short answer: The conda support for R is not very good. You can find some R versions and packages from the official channels, and you may find some via conda-forge. You can find rpy2 via conda-forge, but not with version mathching R 4.x.x

What I do is:

  1. install R via conda(-forge)
  2. install pip via conda
  3. install R packages of choice via R itself using install.packages in R.

This works so-so. I have no problems with it on my windows machine, where I have no global R installation, but I have some trouble on my Linux server where there is a global R.

... but it is the best suggestion I have.

LudvigH
  • 3,662
  • 5
  • 31
  • 49