This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Failure in installing the ggtree, enrichplot, and ggtree (Bioconductor packages )

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!

bioconductor

Could you provide the complete error message ?

![this is the error message generated after entering the code1

enter image description here

The crucial part here is:

Installation paths not writeable, unable to update packages

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 variable R_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 -

  1. Create a folder where you would want the packages to be saved and assign the absolute location to R_LIBS_USER. For example, on your terminal, you can export a path like this -

export R_LIBS_USER=/this/is/the/directory

  1. Optional - specify which version of R you would want to use like this. Use this if you want to use an older or latest version of R as compared to what you already have -

export RSTUDIO_WHICH_R=/path/toR/bin/R

  1. For installing any packages, first run step 1 in your terminal then open R in your terminal. Install packages through the terminal -

install.packages("ggtree")

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

0 answers

No answers yet.

Log in to answer this question.