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
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:Here you have a list of mirrors for R.
i used
chooseCRANmirror(81)
it gives you a prompt to select the country then you can do selection by typing the country mirror code specified there
Here is what I do, which is basically straight from the
example(Startup)
page:which is in
~/.Rprofile
.Edit: As it is now 2018, we can add that for the last few years the URL
"https://cloud.r-project.org"
has been preferable as it reflects a) https access and b) an "always-near-you" CDN.I had, on macOS, the exact thing that you say: A 'please select' prompt and then nothing more.
After I opened (and updated; don't know if that was relevant) X-Quartz, and then restarted R and tried again, I got an X-window list of mirrors to choose from after a few seconds. It was faster the third time onwards.
Add into
~/.Rprofile