[Rd] motivation for setRepositories and chooseCRANmirror

Jeffrey Horner jeff.horner at vanderbilt.edu
Thu Jun 16 17:56:52 CEST 2005

I have some questions and observations about these:

Will these replace manually setting options(CRAN), which doesn't work in 

In R-2.1.0, setRepositories() looks to see if options("repos") contains 
a CRAN entry and will not override that CRAN entry even if the 
$R_HOME/etc/repositories file (which setRepositories reads from) 
contains a  CRAN entry.  Why is this? The user could easily set 
options("repos") without the help of this function anyway? And 
chooseCRANmirror() obviously sets the CRAN entry correctly.

I've checked the latest nightly tarball, R-devel_2005-06-15.tar.gz, and 
this observations persists.

I also observe that the R-2.1.0 Rprofile in the base package sets 
options(repos=c(CRAN="@CRAN@")), so it seems that the only way to set 
the CRAN repository entry is either with chooseCRANmirror() or manually 
setting options("repos") or options("CRAN"). If this was not the case, 
then setRepositories() would choose the CRAN entry from 

In R-2.1.0 and in R-devel_2005-06-15.tar.gz, the R-admin manual suggests 
that for packages to be downloaded and installed within R should set 
options(CRAN = "http://cran.us.r-project.org/"). Will this be changed to 
calling chooseCRANmirror()?

 From an administrator's point of view, I would like to have the CRAN 
option set automatically on R startup for ALL users. That way I don't 
have to set this option before calling update.packages().

Jeffrey Horner       Computer Systems Analyst         School of Medicine
615-322-8606         Department of Biostatistics   Vanderbilt University

More information about the R-devel mailing list