Although the package name miniCRAN
seems to indicate you
can only use CRAN as a repository, you can in fact use any CRAN-like
repository.
This vignette contains some examples of how to refer to different package repositories, including CRAN, alternative mirrors of CRAN, R-Forge as well as BioConductor.
To simplify the code to show the salient features, we use a little
helper function, index()
that is a simple wrapper around
available.packages()
:
# Wrapper around available.packages ---------------------------------------
<- function(url, type = "source", filters = NULL, head = 5, cols = c("Package", "Version")) {
index <- contrib.url(url, type = type)
contribUrl <- available.packages(contribUrl, type = type, filters = filters)
p 1:head, cols]
p[ }
The URL for the master mirror in Austria:
<- "http://cran.r-project.org"
CRAN index(CRAN)
You can also point to any other mirror, for example the stable version hosted by Revolution Analytics:
<- "http://packages.revolutionanalytics.com/cran/3.1/stable"
revoStable index(revoStable)
<- "http://cran.revolutionanalytics.com"
revoMirror index(revoMirror)
R-forge has CRAN-like structure:
<- "http://r-forge.r-project.org"
rforge index(rforge)
Although BioConductor has a different preferred install mechanism, the underlying repository structure is also CRAN-like:
<- local({
bioc <- new.env()
env on.exit(rm(env))
evalq(source("http://bioconductor.org/biocLite.R", local = TRUE), env)
biocinstallRepos()
})
biocgrep("BioC", names(bioc))]
bioc[
index(bioc["BioCsoft"])