Failing to install Phyloseq in R

Hi All,

I am trying to install phyloseq in R, currently using R 4.2.2. but I am getting this error
**Update all/some/none? [a/s/n]: **

The script i used is as follow
if(!requireNamespace("BiocManager")){
install.packages("BiocManager")
}
your textBiocManager::install("phyloseq")

What should I do please assist

Is

**Update all/some/none? [a/s/n]: **

all of the output after you try to install? If not, please post all of the output.

Here is the outputs:

source("~/.active-rstudio-document", echo=TRUE)

if(!requireNamespace("BiocManager")){

  • install.packages("BiocManager")
  • }
    Loading required namespace: BiocManager

BiocManager::install("phyloseq")
'getOption("repos")' replaces Bioconductor standard repositories, see
'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
CRAN: https://cran.rstudio.com/
Bioconductor version 3.16 (BiocManager 1.30.20), R 4.2.2 (2022-10-31
ucrt)
Installation paths not writeable, unable to update packages
path: C:/Program Files/R/R-4.2.2/library
packages:
boot, class, codetools, foreign, MASS, Matrix, mgcv, nlme, spatial,
survival
Old packages: 'blob', 'colorspace', 'commonmark', 'curl', 'data.table',
'dplyr', 'fansi', 'farver', 'forcats', 'fs', 'gtable', 'haven',
'htmlwidgets', 'jsonlite', 'lubridate', 'openxlsx', 'purrr', 'Rcpp',
'readr', 'readxl', 'renv', 'rlang', 'stringi', 'tibble', 'tidyr',
'tidyverse', 'utf8', 'vctrs', 'xfun', 'zip'
Update all/some/none? [a/s/n]:

It looks like a lot of your R packages need to be updated and R cannot do it. Perhaps because some are already loaded?

I"d suggest suggest restarting R and RStudio and running

update.packages(ask=FALSE, checkBuilt=TRUE)

Then try installing {phyloseq} again.

Will do so now, just a moment

Kindly confirm if the update is successful before i go ahead to install phyloseq

  • DONE (renv)

The downloaded source packages are in
‘C:\Users\Paulina\AppData\Local\Temp\RtmpqUXQnd\downloaded_packages’
Warning in install.packages(update[instlib == l, "Package"], l, repos = repos, :
'lib = "C:/Program Files/R/R-4.2.2/library"' is not writable

I have no idea, really; I have not used Windows in years. I would assume you are okay unless you got an actual error messages. My Ubuntu Linux machine gives somewhat similar messages after I install a package successfully. Good luck.

You need to run RStudio as administrator to be able to install packages in that folder, otherwise, usa a user level package library in a folder where you have write permissions.

Hi Andre,

I don't get you, what do you mean run RStudio as an administrator?

Hi P,

This is what andresrcs is talking about.
13 ways to use "Run as administrator" in Windows 10

I have never done it. Linux works slightly differently.

image

I mean run the program with "Administrator" privileges.

I have done that but still getting this outputs

if(!requireNamespace("BiocManager")){

  • install.packages("BiocManager")
  • }
    Loading required namespace: BiocManager

BiocManager::install("phyloseq")
'getOption("repos")' replaces Bioconductor standard repositories, see
'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
CRAN: https://cran.rstudio.com/
Bioconductor version 3.16 (BiocManager 1.30.20), R 4.2.2 (2022-10-31
ucrt)
Old packages: 'commonmark', 'Rcpp', 'renv', 'stringi', 'boot', 'class',
'codetools', 'foreign', 'MASS', 'Matrix', 'mgcv', 'nlme', 'spatial',
'survival'
Update all/some/none? [a/s/n]:
source("~/.active-rstudio-document", echo=TRUE)
Update all/some/none? [a/s/n]:

Those are normal installation messages, what happens when you answer the question?

The problem is how do I answer the question? Someone told me suggested the above but it didn't work.

update.packages(ask=FALSE, checkBuilt=TRUE)

You need to be more specific, saying "it didn't work" doesn't give us any clue on what your current problem might be. Please post the complete console output you get when you try to update your packages.

install.packages("phyloseq")

Output see below

source("~/.active-rstudio-document", echo=TRUE)
Update all/some/none? [a/s/n]:

That is not what I meant, I asked you for the console output when you try to update your CRAN packages. Run this command and post the complete console output you get.

update.packages(ask=FALSE, checkBuilt=TRUE)

See below

downloaded 2.7 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/stringi_1.7.12.zip'
Content type 'application/zip' length 14221653 bytes (13.6 MB)
downloaded 9.9 MB

Error in download.file(url, destfile, method, mode = "wb", ...) :
download from 'https://cran.rstudio.com/bin/windows/contrib/4.2/stringi_1.7.12.zip' failed
In addition: Warning messages:
1: In download.file(url, destfile, method, mode = "wb", ...) :
downloaded length 10375703 != reported length 14221653
2: In download.file(url, destfile, method, mode = "wb", ...) :
URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/stringi_1.7.12.zip': Timeout of 60 seconds was reached
Warning in download.packages(pkgs, destdir = tmpd, available = available, :
download of package ‘stringi’ failed
package ‘commonmark’ successfully unpacked and MD5 sums checked
package ‘Rcpp’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\Paulina\AppData\Local\Temp\RtmpUDeING\downloaded_packages
installing the source package ‘renv’

trying URL 'https://cran.rstudio.com/src/contrib/renv_0.17.2.tar.gz'
Content type 'application/x-gzip' length 1054318 bytes (1.0 MB)
downloaded 1.0 MB

  • installing source package 'renv' ...
    ** package 'renv' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    *** copying figures
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded from temporary location
    ** testing if installed package can be loaded from final location
    ** testing if installed package keeps a record of temporary installation path
  • DONE (renv)

The downloaded source packages are in
‘C:\Users\Paulina\AppData\Local\Temp\RtmpUDeING\downloaded_packages’
Warning in install.packages(update[instlib == l, "Package"], l, repos = repos, :
'lib = "C:/Program Files/R/R-4.2.2/library"' is not writable

This suggests you have connectivity issues, these are some things to try.

  • Choose a different CRAN repository, RStudios repository is a good choice (http://cran.rstudio.com/) or you could choose one that is geographically closer to you.
  • Disable secure download setting. This might help when some download methods are not available in your system
  • Check if your internet connection has traffic restrictions of some kind, like a firewall, proxy server, etc. This is usually the case when you are at work or school.

Also, you are still not running RStudio as administrator so you are not going to be able to install packages on that location, as I said before, either you have to set your package library in a folder where you have write permissions or you need to run RStudio as administrator

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.