如何在R中选择CRAN镜像 [英] How to select a CRAN mirror in R

查看:657
本文介绍了如何在R中选择CRAN镜像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过R提示符执行以下操作来安装软件包:

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

install.packages('RMySQL')

但是输出如下:

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

没有别的!对于这个非常基本的问题,我找不到解决方案.我应该键入什么才能选择CRAN镜像?

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?

OS:Mac-OS X 10.6.8 R版本:2.15.0

OS: Mac-OS X 10.6.8 R Version: 2.15.0

推荐答案

您应该获得一个带有存储库列表的窗口,或者一个带有某些选项的文本菜单.但是,如果未出现,则始终可以使用repos参数来指定从何处下载软件包的镜像.这样,R将不再询问您有关存储库的信息.示例:

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

在这里,您有一个用于R的镜像列表.

这篇关于如何在R中选择CRAN镜像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆