[R] Setting two default CRAN servers under Windows/RStudio
Sigbert Klinke
sigbert at wiwi.hu-berlin.de
Thu Jun 25 11:03:59 CEST 2015
Hi,
I tried the following:
local({r <- getOption("repos")
r["CRAN"] <- "http://local.cran.server/"
r["MIRROR"] <- "http://cran.mirror/"
options(repos=r)
})
But: R seems always to take the "CRAN" entry first, therefore I put our
local mirror there.
If a R session starts and the "CRAN" server is not available then a
package is taken from the "MIRROR" server. If the server comes up during
the session then the next install.packages will use the "CRAN" server.
But if the "CRAN" server becomes unavailable during a session then the
"MIRROR" server is not checked and I get an error message "download of
package 'xyz' failed".
Any ideas?
Sigbert
Am 19.06.2015 um 15:32 schrieb Thierry Onkelinx:
> We have this in our Rprofile.site This works fine. It checks each mirror
> and installs (or updates) the latest version available on all mirrors. e.g.
> abc 0.1 on RStudio and abc 0.2 on RForge, then abc 0.2 from RForge gets
> installed/updated.
>
> options(
> repos = c(
> RStudio = "http://cran.rstudio.com/",
> RForge = "http://r-forge.r-project.org",
> Belgium = "http://www.freestatistics.org/cran/",
> CRAN = "http://cran.at.r-project.org/",
> Oxford = "http://www.stats.ox.ac.uk/pub/RWin"
> ),
> install.packages.check.source = "no"
> )
--
http://u.hu-berlin.de/sk
More information about the R-help
mailing list