conda install r-essentials takes forever - r

I am unable to install the r-base and r-essentials packages into my conda environment. Whenever I run
conda install -c r r-base r-essentials
I just get the Solving environment message for a good hour or more before I just exit out altogether. This even occurs when I create a brand new environment without any other packages before attempting to install r-base and r-essentials.
What is going on here and is there any way to fix this?

Try that. conda install -c conda-forge r r-essentials.

For some reason there is a conflict when r-essentials and pip are in the same conda environment. You can solve it by creating a new environment that has the package directly:
conda create -n r_env -c r r-essentials

Related

Installing R development version in Conda environment

I would like to install R development version (i.e. latest daily snapshot) inside a conda environment. I haven't found any conda package that would allow me to install such a version from conda directly. I can install it from source, but I'm not sure how well that would work. Any suggestion on whether this is possible or do you know of any other preferable way to perform the installation? I'm aware I could use a container, but I'd rather avoid that option for now. Thanks!
No Anaconda Cloud channels build the R development version.
Conda is a package manager that works with non-Python packages as well. Before installing any packages, you should set up a new conda environment with conda create -n r-env (replace env-name with your desired name). Then you need to activate it with conda activate r-env. Then you can install the essential R packages with conda install r-essentials -c conda-forge.
In case you are unfamiliar with the -c flag, it tells conda to look at a specific channel when looking for your packages. -c conda-forge thus searches on the conda-forge-channel.

R fails to load igraph in conda environment

I am trying to run an RShiny app in a WSL2 installation of Ubuntu on Windows. I am no expert in R, but I feel this is a problem due to conda interaction with R. I run the following commands:
conda create -n r_env r-essentials r-base
conda activate r_env
conda install -c conda-forge r-shiny
conda install -c r r-visnetwork
conda install -c conda-forge r-dplyr
conda install -c r r-dt
conda install -c conda-forge r-igraph
conda install -c r r-leaflet
conda install -c conda-forge r-rgdal
conda install -c r r-shinydashboard
conda install -c conda-forge r-shinywidgets
conda install -c conda-forge r-shinycssloaders
conda install -c conda-forge r-igraph
When I run R and type in : library(igraph) i get:
->Error: package or namespace load failed for ‘igraph’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/carlo/anaconda3/envs/r_env/lib/R/library/igraph/libs/igraph.so':
but I can list it, it's there:
ll /home/carlo/anaconda3/envs/r_env/lib/R/library/igraph/libs/igraph.so
-> -rwxrwxr-x 1 carlo carlo 3816608 Mar 31 15:38 /home/carlo/anaconda3/envs/r_env/lib/R/library/igraph/libs/igraph.so
Did anybody encounter a similar problem?
The igraph library was meant to load correctly
(My Opinion) I would caution against the use of the r channel and the r-essentials package. The Continuum/Anaconda support for R was a good college-try, but is since outmoded and superseded by the broader CRAN support that Conda Forge provides. Users managing R environments will find a better experience ignoring any Continuum/Anaconda documentation and exclusively using Conda Forge for their R environments. (End Opinion)
Mixing channels can lead to symbol reference errors. Furthermore, sequences of ad hoc installations are subpar - instead specify through a YAML.
The following YAML file works just fine on linux-64, osx-64, and win-64 platforms:
so-igraph.yaml
name: so-igraph
channels:
- conda-forge
dependencies:
- r-base=4.1 # adjust to desired version
- r-shiny
- r-visnetwork
- r-dplyr
- r-dt
- r-igraph
- r-leaflet
- r-rgdal
- r-shinydashboard
- r-shinywidgets
- r-shinycssloaders
- r-igraph
Which can be used with
conda env create -n so-igraph -f so-igraph.yaml
conda activate so-igraph
I was having a similar problem with R on AlmaLinux, and it turned out I was missing some libraries on the OS itself, which I thought I had and that were necessary for some R packages. I think they were these, which makes sense, given that we're talking about igraph, a graphing package:
gsl-devel-2.5-1.el8.x86_64
gsl-2.5-1.el8.x86_64
openssl-1.1.1k-6.el8_5.x86_64
geos-devel-3.7.2-1.el8.x86_64
geos-3.7.2-1.el8.x86_64
proj-datumgrid-1.8-6.3.2.4.el8.noarch
proj-6.3.2-4.el8.x86_64
libtiff-devel-4.0.9-21.el8.x86_64
libgeotiff-devel-1.5.1-1.el8.x86_64
libgeotiff-1.5.1-1.el8.x86_64
Installing openblas may work, see https://github.com/conda-forge/r-igraph-feedstock/issues/19

Failing to conda build R package

I'm trying to use conda and Jupypter to write some R code. I found a useful package called 'treatSens' and tried to install via conda following the instructions here.
conda install conda-build
conda skeleton cran treatSens
conda build r-treatsens
conda install -c local r-treatsens
Then I got this error conda_build.exceptions.DependencyNeedsBuildingError: Unsatisfiable dependencies for platform osx-64: {"r-dbarts[version='>=0.9_1']"}. How do I satisfy this dependency? Any suggestion is appreciated.
===UPDATE====
Added --recursive then I got a new error, posted a new question
here.
Try the following:
conda install conda-build
conda skeleton cran --recursive treatSens
conda build r-treatsens
conda install -c local r-treatsens
The recursive option should account for the dependencies you need.

How to uninstall r-essentials using conda?

Recently, I installed r-essentials using conda command: conda install -c r r-essentials as it is described in this url: https://anaconda.org/r/r-essentials. However, when I try to run a new R Kernel, ii fails according to this error:
...Anaconda3\R/bin/x64/Rterm.exe' is not recognized as an internal or external command, operable program or batch file.
I want to remove R folder that was created after installation But I cannot find a way to remove that folder.
I tried:
conda uninstall r-essentials
Then:
conda remove R
Last one, according to this answer on reddit: https://www.reddit.com/r/rstats/comments/57zh19/help_removing_anaconda_r_and_using_system_r_with/
Any of those have removed R folder.
Is there an specific command to remove it?
r-essentials is a metapackage, and therefore cannot be uninstalled this way.
Try running conda uninstall r-base to uninstall Anaconda R, and then install R regularly. Then, run which R to make sure that it works. You should now see the path to the system R, instead of the Anaconda R.
I recommend then following the instructions here - this installation worked for me: http://irkernel.github.io/.
to remove r packages, run the conda prompt as an administrator. then execute this command
conda remove r-*
conda uninstall r-base >> jupyter notebook has something file and button
I think you can try $conda list | grep r // see r package files
$conda uninstall r-* // delete all r package

Anaconda Jupyter R install

Hi I tried to install R for my Jupyter notebook (Anaconda) and used the below command in my Anaconda prompt "conda install -c r r-essentials". But there is an error like below: any suggestions (especially missing package).
(C:\Anaconda3) C:\windows\system32>conda install -c r r-essentials
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata ...Could not connect to
https://repo.continuum.io/pkgs
/pro/noarch/
Could not connect to https://repo.continuum.io/pkgs/free/win-64/
Could not connect to https://repo.continuum.io/pkgs/pro/win-64/
...Could not connect to https://conda.anaconda.org/r/win-64/
.Could not connect to https://conda.anaconda.org/r/noarch/
.Could not connect to https://repo.continuum.io/pkgs/free/noarch/
.
Solving package specifications: .
Error: Package missing in current win-64 channels:
- r-essentials
You can search for packages on anaconda.org with
anaconda search -t conda r-essentials
(C:\Anaconda3) C:\windows\system32>
Thanks
Try this alternative. It worked on my colleague's machine:
conda create -n my-r-env -c r r-essentials
Another approach would be to reinstall Anaconda and execute
conda install -c r r-essentials
Let us know if it worked.

Resources