Entering edit mode
16 months ago
applepie
▴
10
Hello everyone! Yesterday, I tried to install ggtree, enrichplot, and ggtree in my RStudio (verision 4.1.0) but it turned out they couldn't be successfully installed and a few warning messages popped out, though I had already installed all the dependent packages:
Warning messages:
1: In .inet_warning(msg) :
installation of package 'ggtree' had non-zero exit status
2: In .inet_warning(msg) :
installation of package 'enrichplot' had non-zero exit status
3: In .inet_warning(msg) :
installation of package 'clusterProfiler' had non-zero exit status
And the command i have run to install the packages are:
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(version = "3.14")
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install()
BiocManager::install(c("ggtree", "enrichplot","clusterProfiler"))
Does anyone know what's wrong with my RStudio? Thank you!
Could you provide the complete error message ?
![this is the error message generated after entering the code1
The crucial part here is:
Your R library path points to
/opt/R/4.1.0/lib/R/library
. So either you change write permissions of that folder, run the installation with sudo or (my recommendation) use a library path within your user directory by assigning it to the environment variableR_LIBS_USER
.so may I ask should do that on terminal or RStudio? How can I modify the library path with my present working directory? (like what are the script involved?
Here is one way of doing it on the terminal -
R_LIBS_USER
. For example, on your terminal, you can export a path like this -Another option to do this is installing conda and installing packages through conda (optionally also mamba). This way you create an environment where you can install packages
Yes, that is a good approach to try it out and choose the corresponding paths. For a persistent setup, customize the
.Renviron
and/or.Rprofile
files in e.g. your home directory. See this helpful introduction for a starter and the deeper dive for more customization options.