Installing R Studio with Anaconda

Rstudio in anaconda environment: how should I install R packages?

Anaconda is a package manager/self-contained workspace and should be used to install packages if using R through a conda environment.

To install desolve, you'll want to run the below from your conda environment. You can search for the conda availability of an R package here: https://anaconda.org/conda-forge

conda install -c conda-forge r-desolve

In my experience, conda-forge often has more updated versions of R packages and one should look there first for the install.

Why does using conda to install rstudio, r version 4, using conda on my linux system return an error about incompatable specifications?

Looks like an issue with dependencies, as rstudio does not seem to be solvable with r-base=4.0.* specified.

This works:
conda create -c conda-forge -n r4rs r-base rstudio
This does not:
conda create -c conda-forge -n r4rs r-base=4.0.* rstudio

Probable reason might be that the rstudio package in the conda channel is not very actively maintained and hasn't seen an update in over a year, see here

Depending on what can give here, you could:

  1. Accept the option of conda create -c conda-forge -n r4rs r-base rstudio which will give you r-base<4.0

  2. Download and install your own version of rstudio from the official website and create an environment with just r-base==4.0.*, activate that env and then start your downloaded rstudio, which should detect the r you have installed into the conda env. See also this post

Can't install recent version of Rstudio in Ubuntu 22.04 through anaconda

Don't use the r channel - Anaconda has not kept up maintenance on it. Instead, use Conda Forge. Also, I would strongly discourage installing anything R in an Anaconda base environment or any other environment that has Python installed. Instead, create a new one:

conda create -n rstudio -c conda-forge rstudio-desktop r-base=4.1

Specifying the r-base, which controls the version, is optional but recommended. This should work for either 4.0 or 4.1.



Additional Commentary

I'm a strong advocate of keeping infrastructure and execution environments separated. This allows one to keep updating them independent. Unlike Jupyter, RStudio still doesn't have clean way to load Conda R environments. For that reason, I still recommend using a native RStudio installation, as described in this answer.

RStudio does not launch from Anaconda

I also had a lot of problems for many months trying to use RStudio with Anaconda. There were so many problems (files were sometimes not saved, new R-Environments could not be created, RStudio could not be installed, packages were not correctly loaded etc.). I found also several others in the Internet who have experiencend similar problems. This is why I just installed RStudio and the base R directly without Anaconda and so far I have not had any problems with that.



Related Topics



Leave a reply



Submit