Failure in installing the ggtree, enrichplot, and ggtree (Bioconductor packages )
0
0
Entering edit mode
12 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!

Bioconductor • 2.2k views
ADD COMMENT
0
Entering edit mode

Could you provide the complete error message ?

ADD REPLY
0
Entering edit mode

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

enter image description here

ADD REPLY
2
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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?

ADD REPLY
2
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 3142 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6