赞
踩
Warning in install.packages :
InternetOpenUrl failed: '无法与服务器建立连接'
Warning in install.packages :
InternetOpenUrl failed: '无法与服务器建立连接'
Warning in install.packages :
unable to access index for repository https://cran.rstudio.com/bin/windows/contrib/3.2
Packages which are only available in source form, and may
need compilation of C/C++/Fortran: ‘reshape2’ ‘NMF’
‘igraph’
These will not be installed
installing the source packages ‘ggplot2’, ‘magrittr’, ‘irlba’
trying URL 'https://cran.rstudio.com/src/contrib/ggplot2_1.0.1.tar.gz'
Warning in install.packages :
InternetOpenUrl failed: '无法与服务器建立连接'
Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL 'https://cran.rstudio.com/src/contrib/ggplot2_1.0.1.tar.gz'
Warning in install.packages :
download of package ‘ggplot2’ failed
trying URL 'https://cran.rstudio.com/src/contrib/magrittr_1.5.tar.gz'

其实换个CRAN即可。
步骤:
1.首先,你可以打开 http://mirror.bjtu.edu.cn/cran/这个网站,选择一个合适的镜像地址
2.到你的R软件目录下,找到Rprofile.site这个文件,(E:\R-3.2.21\etc\Rprofile.site 这是我的目录)
3.打开,添加以下设置
# set a CRAN mirror
local({r <- getOption("repos")
r["CRAN"] <- "http://mirrors.xmu.edu.cn/CRAN/"
options(repos=r)})
其中r["CRAN"] <- "http://mirrors.xmu.edu.cn/CRAN/" 中的右方为你所选择的镜像地址
4.在R的CONSOLE中安装包即可。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。