Bioconductor : Setting local install directory for packages
2
1
Entering edit mode
9.2 years ago

I have installed Bioconductor (see R terminal below):

> source("http://bioconductor.org/biocLite.R")
> biocLite()
.
.
.
Warning in install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
  'lib = "/usr/lib64/R/library"' is not writable
Would you like to use a personal library instead?  (y/n) y
Would you like to create a personal library
~/R/x86_64-redhat-linux-gnu-library/3.2
to install packages into?  (y/n) n

If I say no to the default directory, it boots me out of the installation with the error:

Error in install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  : unable to install packages

I want to install the Bioconductor packages in a directory of my choosing without it cluttering up my home directory. How do I do this?

RNA-Seq bioconductor • 32k views
ADD COMMENT
4
Entering edit mode
9.2 years ago
Lemire ▴ 940

Just like for install.packages, you can specify the location using the lib argument:

biocLite(pkgs, lib="~/R/library")
?biocLite

     ...: Additional arguments. 'lib.loc' is passed to 'old.packages'
          (used to determine the library location of installed packages
          to be updated). 'lib' is passed to 'install.packages' (used
          to determine the library location where 'pkgs' are to be
          installed).
ADD COMMENT
0
Entering edit mode

Actually, that does work... i.e.

> biocLite("easyRNASeq", lib="/path/to/home/local/R-3.2.1")

yields

.
.
.
Old packages: 'boot', 'class', 'cluster', 'codetools', 'foreign', 'KernSmooth',
  'lattice', 'MASS', 'Matrix', 'mgcv', 'nlme', 'nnet', 'rpart', 'spatial',
  'survival'

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

Warning in install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
  'lib = "/usr/lib64/R/library"' is not writable
Would you like to use a personal library instead?  (y/n) y

Would you like to create a personal library
~/R/x86_64-redhat-linux-gnu-library/3.2
to install packages into?  (y/n) n

Error in install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  : 
  unable to install packages

It appears that it installed easyRNASeq and associated packages in the correct location. It is however still giving me an error and it won't let put the updated source packages in a directory of my choosing.

ADD REPLY
4
Entering edit mode
8.8 years ago
charco ▴ 50

You also need to tell it where to look for old packages to update. This should fix the error:

biocLite(pkgs, lib.loc = "~/R/local_library", lib="~/R/local_library")

From ?biocLite():

Additional arguments. 'lib.loc' is passed to 'old.packages' (used to determine the library location of installed packages to be updated). 'lib' is passed to 'install.packages' (used to determine the library location where 'pkgs' are to be installed).
ADD COMMENT

Login before adding your answer.

Traffic: 1612 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