1

I'm having trouble installing sleuth into R studio. I have already tried troubleshooting using the suggested methods in a stockoverflow titled "installation path not writable R, unable to update packages" (link: installation path not writable R, unable to update packages). I keep getting the following error.

Error Message:

Bioconductor version 3.10 (BiocManager 1.30.10), R 3.6.1 (2019-07-05)
Installation path not writeable, unable to update packages: boot, class, foreign, KernSmooth, lattice,
  MASS, Matrix, mgcv, nlme, nnet
Old packages: 'isoband', 'purrr', 'RcppArmadillo', 'RCurl', 'reshape2', 'survival'
Update all/some/none? [a/s/n]: 
BiocManager::install("devtools")    # only if devtools not yet installed
Update all/some/none? [a/s/n]: 
BiocManager::install("pachterlab/sleuth")
Update all/some/none? [a/s/n]:

When I type in this code:

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install()
BiocManager::install("devtools")    # only if devtools not yet installed
BiocManager::install("pachterlab/sleuth")

Thank you for your help!

milanmlft
  • 411
  • 3
  • 14

1 Answers1

1

This answer might be helpful.

It looks like the offending packages (boot, class, foreign, etc.) are installed in a location where you do not have writing permissions for.

In principle, the sleuth package should have been installed, despite the error messages (you can check this by running library(sleuth) in an R console). However, to avoid having these errors each time you try installing a (BioConductor) package, I would recommend to re-install those offending packages in a directory where you have writing access to. Depending on your OS this can be in different locations.

I found this guide particularly useful to maintain R packages.

In short (all commands are run in R):

  1. Remove the packages mentioned in the error message with remove.packages(), if sleuth was installed, remove it as well, we will install it again later in a more maintainable way
  2. In R, check the output of Sys.getenv("R_LIBS_USER"), this should normally be a directory path under your home directory
  3. It's likely that the R_LIBS_USER directory does not yet exist, create it with dir.create(Sys.getenv("R_LIBS_USER"))
  4. Restart R (in RStudio, you can do SessionRestart R
  5. Check the output of .libPaths(), the first element should now be the directory you just created (i.e. the same as Sys.getenv("R_LIBS_USER")), this is now the default directory where R packages will be installed
  6. Install sleuth again with BiocManager::install("pachterlab/sleuth"), this should normally also install all dependencies. If not you might have to install them separately.

Hope this helps!

milanmlft
  • 411
  • 3
  • 14