I'm having a problem installing some R packages on an Ubuntu OS. I've tried a number of suggested solutions in various blogs and SO answers but the problem persists.
The default location for installing packages is 'lib = "/usr/lib/R/library"'
Using the commands
source("http://bioconductor.org/biocLite.R")
biocLite('affycoretools')
Fails because 'lib = "/usr/lib/R/library"'
is not a writable location for me (note that I do have sudo access). I therefore want these packages to be installed to this location which is writable:
lib='/home/b3053674/R/x86_64-pc-linux-gnu-library/3.2'
So the first thing I try is:
biocLite('affycoretools,lib=lib)
Which seems to work but now:
library(affycoretools)
#try specifying location
library(affycoretools,lib=lib)
#try alternative keyword - just in case
library(affycoretools,lib.loc=lib)
all fail with there is no package called ‘affycoretools’
.
I then tried this answer which suggests that I create an R_LIBS_USER
variable. I therefore used export R_LIBS_USER="/home/b3053674/R/x86_64-pc-linux-gnu-library/3.2"
and tried again but this seemed to do precisely nothing. I've also attempted to put this variable in a file in the home directory called .Renviron
which also does nothing. I've tried giving the new library path to R_LIBS
environment variable instead but again nothing. I've also tried a few other solutions regarding the .libPaths()
and .Library
function/variables but not joy...
I'm guessing this type of configuration is fairly routine to people who know R but everything I try seems to fail so my question is: could anybody give me precise and clear instructions to setting up an alternative writable library for my bioconductor packages in R on an Ubuntu 16.04.1
OS?