出错信息:
Warning in install.packages :
InternetOpenUrl failed: ‘’
Warning in install.packages :
InternetOpenUrl failed: ‘’
Warning in install.packages :
unable to access index for repository
https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib:
cannot open URL ‘
https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib/PACKAGES
’
Warning in install.packages :
InternetOpenUrl failed: ‘’
Warning in install.packages :
InternetOpenUrl failed: ‘’
Warning in install.packages :
unable to access index for repository
http://www.stats.ox.ac.uk/pub/RWin/src/contrib:
cannot open URL ‘
http://www.stats.ox.ac.uk/pub/RWin/src/contrib/PACKAGES
’
解决办法:
进入到R的安装目录,编辑/etc/Rprofile.site
在红框位置添加语句:options(download.file.method=“libcurl”)
保存修改,并重新打开RStudio,重新运行install.packages()语句即可