package ‘edgeR’ is not available (for R version 3.1.2)
4
0
Entering edit mode
@patrick-schorderet-6081
Last seen 9.0 years ago
United States

Dear all,

I am having some issues with the installation of some packages. I have written an R package that I would like to share with some computer-reluctant biologists. To make it easy, I have written a simple R function to install all required packages (see below with limited number of packages for the example).

install_packages <- function(){

    # Open R and install packages
    local({r <- getOption("repos")
        r["CRAN"] <- "http://cran.r-project.org
        options(repos=r)
    })

    # Define a vector with the names of all required packages
    package <- c( 'AnnotationDbi', 'caTools', 'edgeR', 'GenomicRanges', 'GenomicAlignments', 'gtools', 'Rsamtools', 'VennDiagram' )
     
    # Install required packages
    for(k in 1:length(package)){
           cat("\n\t\t", k, ".\t Installing ", package[k], sep='')
           install.packages(package[k], dependencies=TRUE);
     }

}


It works well for most standard packages, but some packages are problematic, giving me error messages of this kind:

package ‘edgeR’ is not available (for R version 3.1.2)

I have tried a gazillion things, but I can’t figure out why I get these ‘warnings’ and don’t understand why they are not ‘errors’. Any help would be greatly appreciated.
Thanks,

Patrick

PS: I know that these packages are installed on my machine, but I am trying to do this for other computers. Thanks.
 

sessionInfo()

R version 3.1.2 (2014-10-31)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] grid      parallel  stats4    stats     graphics  grDevices utils    
[8] datasets  methods   base     

other attached packages:
[1] VennDiagram_1.6.9       gtools_3.4.1            GenomicAlignments_1.2.1
[4] Rsamtools_1.18.2        Biostrings_2.34.1       XVector_0.6.0          
[7] GenomicRanges_1.18.4    edgeR_3.8.5             limma_3.22.4           
[10] caTools_1.17.1          AnnotationDbi_1.28.1    GenomeInfoDb_1.2.4     
[13] IRanges_2.0.1           S4Vectors_0.4.0         Biobase_2.26.0         
[16] BiocGenerics_0.12.1    

loaded via a namespace (and not attached):
[1] base64enc_0.1-2    BatchJobs_1.5      BBmisc_1.9         BiocParallel_1.0.3
[5] bitops_1.0-6       brew_1.0-6         checkmate_1.5.1    codetools_0.2-10  
[9] DBI_0.3.1          digest_0.6.8       fail_1.2           foreach_1.4.2     
[13] iterators_1.0.7    RSQLite_1.0.0      sendmailR_1.2-1    stringr_0.6.2     
[17] tools_3.1.2        zlibbioc_1.12.0   

edgeR packages • 15k views
ADD COMMENT
3
Entering edit mode
@james-w-macdonald-5106
Last seen 7 hours ago
United States

You are re-inventing the wheel here. Plus, install.packages() is quite happy to install using a vector of package names.

A simpler thing would be to write a script like so, and save it as, say 'installme.R'

source("https://www.bioconductor.org/biocLite.R")

biocLite(c('AnnotationDbi', 'caTools', 'edgeR', 'GenomicRanges', 'GenomicAlignments', 'gtools', 'Rsamtools', 'VennDiagram' ), ask = FALSE)

Then tell your recalcitrant biologist types to open R and then do

source("installme.R")

But do note that if your reluctant biologist friends are getting hung up on something like installing packages, you most likely have much larger problems...

ADD COMMENT
0
Entering edit mode

hahaha, yeah, let's not talk about that ;-)

Thanks!

ADD REPLY
1
Entering edit mode
@martin-morgan-1513
Last seen 19 hours ago
United States

You haven't specified a bioconductor repository. Also, install.packages() works on a vector. Why not simply

## Install & / or load 'BiocInstaller', then use biocLite()
source("http://bioconductor.org/biocLite.R")
BiocInstaller::biocLite(packages)

? This works for CRAN and Bioconductor packages. Alternatively, set up an AMI or use a pre-configured docker instance running Rstudio!

ADD COMMENT
0
Entering edit mode
@patrick-schorderet-6081
Last seen 9.0 years ago
United States

Sweet! worked perfectly. Thanks so much!

PS: weird thing though: when i installed BiocInstaller, I got the same warning message:

Warning message:

package ‘BiocInstaller’ is not available (for R version 3.1.2)

Is this a known bug???

Thanks again!

ADD COMMENT
0
Entering edit mode

How did you install BiocInstaller? The recommended way is as Martin suggested above, by sourcing the biocLite.R script. If you do that you should not see the warning.

ADD REPLY
0
Entering edit mode
@patrick-schorderet-6081
Last seen 9.0 years ago
United States

You are right, it had something to do with how I installed BiocLite. Martin's solution works. Thanks guys!

ADD COMMENT
0
Entering edit mode

No. You need to provide the full transcript of what you are doing and how R is responding in order for us to determine why you are seeing the warning. 

ADD REPLY

Login before adding your answer.

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