I’ve been unable to get some R libraries to install on my Linux laptop. Two libraries in particular were
tidyverse. The same libraries installed just fine on Windows. (Maybe you need to install Rtools first before installing these on Windows; I don’t remember.)
conda all the time with Python, but I hadn’t tried it with R until this evening. Apparently it just works. The libraries I was trying to install have a lot of dependencies, and
conda is very good at managing dependencies.
I removed my installation of R and reinstalled from
conda install r-base
Then I installed
conda install r-tseries
conda install r-tidyverse
r- to the name of the R library you want to install.
I haven’t used it in anger yet, but it seems that everything works just fine.
6 thoughts on “R with Conda”
It may be irrelevant now that you have it installed through conda, but tidyverse has never posed a problem on either my desktop or my laptop (both running Linux Mint). I don’t recall if it needs rJava, which can be a bit finicky to install. If you decide you need the original (non-conda) version, and you run into problems, you might post the output from the installer, along with which Linux distribution you are using.
It’s interesting to know that conda works smoothly with R, but I note that it’s trivial to install both of the packages you mention
directly from CRAN, i.e., within R. I just tried it:
No problem with either.
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS
Rather than say it’s trivial, I’d say it can be trivial. It was trivial on one of my computers but not on another one. On one the
install.packages()commands worked and on another they did not.
I’ve often had trouble managing library versions with R. I’d try to use
install.packagesand it would fail. I’d end up wiping out R and all its libraries, then reinstalling the latest version of everything. That usually works, though even that didn’t work in the situation I wrote about.
I’ve seen problems with R packages that were at least somewhat similar to the problems you mention. They were typically related to permission problems and/or updates to R itself. But there are well-known solutions to both. If you send me a log (or screenshot or …) of an instance of your problem, I’ll see if I can provide any useful advice.
You R with Conda?
Sorry, not sorry.
I use regularly R with Conda. Everytime I start a new project, I create a new conda environment with the R packages I am going to need. I can add more if I need them later on. It saves me from the headaches of having to deal with one unique installation of R and all the dependencies I need for the diferent projects I am working on.