2

Most CRAN packages are <100mb and are consistent across mirrors, hence speed and/or consistency would be unlikely candidates.

For context, an extremely simple terminal command like R -e 'install.packages("testthat")' errors with

Error in contrib.url(repos, "source") : 
  trying to use CRAN without setting a mirror
Calls: install.packages -> contrib.url
Execution halted

whereas most R users would expect that code to work, since they'll have run it from R scripts, and from the R interpreter (or rstudio).

What is the purpose of forcing mirror selection? (it may sound rhetorical but I am genuinely curious)

stevec
  • 41,291
  • 27
  • 223
  • 311

1 Answers1

-1

Setting a CRAN mirror can explicitly tell R where to retrieve sources from.

Please choose a location close to you.

The above line, from https://cran.r-project.org/mirrors.html, hints that selecting a close mirror is wise. This is because it can increase speed for which you download as well as reducing stress on the CRAN servers. For information on how to do that, see this thread: How to select a CRAN mirror in R

Sure this could be programmed into it, but it is a simple enough step to get people more involved with their R setup.

sempervent
  • 833
  • 2
  • 11
  • 23