How to install R packages that are not available in R-essentials?
Now I have found the documentation:
This is the documentation that explains how to generate R packages that are only available in the CRAN repository:
https://www.continuum.io/content/conda-data-science
Go to the section "Building a conda R package".
(Hint: As long as the R package is available under anaconda.org use this resource. See here: https://www.continuum.io/blog/developer/jupyter-and-conda-r)
alistaire's answer is another possibility to add R packages:
If you install packages from inside of R via the regular install.packages
(from CRAN mirrors), or devtools::install_github
(from GitHub), they work fine. @alistaire
How to do this:
Open your (independent) R installation, then run the following command:
install.packages("png", "/home/user/anaconda3/lib/R/library")
to add new package to the correct R library used by Jupyter, otherwise the package will be installed in /home/user/R/i686-pc-linux-gnu-library/3.2/png/libs mentioned in .libPaths() .
How to install R-packages not in the conda repositories?
In the end, I got around the rl_event_hook
problems by following the approach recommended here and symlinking anaconda's libreadline to the system one:
mv ~/anaconda3/lib/libreadline.s.6.2 ~/anaconda3/lib/libreadline.s.6.2.bak
ln -s /usr/lib/libreadline.so.6.3 ~/anaconda3/lib/libreadline.s.6.2
I am still having troubles installing some dependency heavy R-packages due to failure to load shared objects when using install.packages()
from withing R. However, simpler packages work fine and I can get most of the dependency heavy packages from anacondas R-repositories.
R-Package not found for conda
This is now available through Conda Forge. Try
conda install -c conda-forge r-miceadds
Set up conda environment for R package not on CRAN, installs to wrong location
First, the devtools
isn't showing up because R packages in Conda repositories are conventionally prefixed with "r-
", so installing conda install r-devtools
should do the trick. However, I don't think Conda is the best strategy here.
Below R version 3.6, the Conda package coverage for R packages is rather poor. Also, installing non-Conda packages that require compilation into a Conda R environment is a pain and generally doesn't work out-of-the-box in my experience. Plus, not only does the TreeLS
require compilation, but it has dependencies that are not Conda packages which require compilation. I would avoid this.
Option 1 is feasible. R allows multiple installations, and with manipulating environment variables (I think RSTUDIO_WHICH_R
, R_LIBS
are the pertinent ones) one can switch between them.
However, were this my situation, I'd spin up a docker container, probably rocker/rstudio:3.5
and use that for this project. Since the underlying image is Linux, it'll take awhile to compile, but you can version it at that point and then always have that available to spin up. This avoids having to muck around with any system settings and should be mostly straight-forward installing.
How to install packages in conda that are not available in anaconda
in terminal type:
conda activate <env_name>
then:
pip install edx-dl
will work on conda env this library
Errors building R-packages for conda
Although I started out with a different problem, the final solution turned out to be the same as I posted elsewhere How to install R-packages not in the conda repositories?. I am adding it here for completeness.
In the end, I got around the rl_event_hook
problems by following the approach recommended here and symlinking anaconda's libreadline to the system one:
mv ~/anaconda3/lib/libreadline.s.6.2 ~/anaconda3/lib/libreadline.s.6.2.bak
ln -s /usr/lib/libreadline.so.6.3 ~/anaconda3/lib/libreadline.s.6.2
I am still having troubles installing some dependency heavy R-packages due to failure to load shared objects when using install.packages()
from withing R. However, simpler packages work fine and I can get most of the dependency heavy packages from anacondas R-repositories.
Related Topics
Replace Nas with Mean of the Same Column of a Data.Table
How to Add Gaussian Curve to Histogram Created with Qplot
How to Adjust the Font Size of Tablegrob
How to Filter on Partial Match Using Sparklyr
Rsqlite Query with User Specified Variable in the Where Field
Difference of Prediction Results in Random Forest Model
Ggplot Set Scale_Color_Gradientn Manually
How to Colour the Labels of a Dendrogram by an Additional Factor Variable in R
Replace Nas in One Variable with Values from Another Variable
How to Pass Vector to Integrate Function
Replicate a List to Create a List-Of-Lists
R, Conditionally Remove Duplicate Rows
How to Always Display 3 Decimal Places in Datatables in R Shiny
Specify Position of Geom_Text by Keywords Like "Top", "Bottom", "Left", "Right", "Center"
Categorical Scatter Plot with Mean Segments Using Ggplot2 in R