Skip to content
Prev 248222 / 398506 Next

Setting bioconductor repository in .Rprofile. Is there a permanent way?

On 01/24/2011 10:45 AM, Kevin Wright wrote:
one possibility is to

  source('http://bioconductor.org/biocLite.R')

in .Rprofile, after which biocinstallRepos() provides the correct bioc
repositories for the version of R in use; it does clutter the .GlobalEnv
a little and would be irritating if, e.g., on a laptop,  internet access
were slow or not reliable. For the latter I wrote

makeActiveBinding("biocLite", local({
    env <- new.env()
    function() {
        if (!exists("biocLite", envir=env, inherits=FALSE)) {
            evalq(source("http://bioconductor.org/biocLite.R",
                         local=TRUE),
                  env)
        }
        env[["biocLite"]]
    }
}), .GlobalEnv)

which doesn't make the connection until one accesses the biocLite variable.

Martin