How to select a CRAN mirror in R

Jim Johnson picture Jim Johnson · Jul 15, 2012 · Viewed 235.5k times · Source

I'm trying to install a package through the R prompt by doing the following:

install.packages('RMySQL')

But the output is as follows:

--- Please select a CRAN mirror for use in this session ---

And nothing else! I can't find a solution to this very basic problem. What am I supposed to type in order to select a CRAN mirror?

EDIT:

OS: Mac-OS X 10.6.8 R Version: 2.15.0

Answer

betabandido picture betabandido · Jul 15, 2012

You should either get a window with a list of repositories or a text menu with some options. But if that is not appearing, you can always specify the mirror from where to download the packages yourself by using repos parameter. By doing that, R will not ask you anymore about the repository. Example:

install.packages('RMySQL', repos='http://cran.us.r-project.org')

Here you have a list of mirrors for R.