[R] Setting two default CRAN servers under Windows/RStudio

Thierry Onkelinx thierry.onkelinx at inbo.be
Fri Jun 19 15:32:40 CEST 2015


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"
)

Best regards,

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

2015-06-19 14:14 GMT+02:00 Sigbert Klinke <sigbert op wiwi.hu-berlin.de>:

> Hi,
>
> we are running in our network a non-public CRAN mirror. I got it working
> with the entry in "Rprofile.site"
>
> local({r <- getOption("repos")
>        r["CRAN"] <- "http://local.cran.server"
>        options(repos=r)
> })
>
> In case that our CRAN mirror does not work we want to send the R/RStudio
> users to a public server. I tried
>
> 1.
> local({r <- getOption("repos")
>        r["CRAN"] <- c("CRAN"="http://local.cran.server", r)
>        options(repos=r)
> })
>
> -> install.packages offered the list of public mirrors
>
> 2.
> local({r <- getOption("repos")
>        r["CRAN"] <- c(r, "CRAN"="http://local.cran.server")
>        options(repos=r)
> })
>
> -> packages are taken from cran.rstudio.com
>
> 3.
> local({r <- getOption("repos")
>        r["CRAN"] <- c(r["CRAN"], "CRAN"="http://local.cran.server",
> r["CRANextra"])
>        options(repos=r)
> })
>
> -> packages are taken from cran.rstudio.com
>
> None of the solutions worked under RStudio, the packages are always
> installed from the public servers. Any ideas?
>
> Thanks Sigbert
> ______________________________________________
> R-help op r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list