R语言日常笔记(3)R包install失败:cannot open URL

R语言包安装问题:

R语言日常笔记(3)R包install失败:cannot open URL_第1张图片

这是一类包的安装问题:

R包install失败:cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'

Warning: unable to access index for repository https://mirrors.ustc.edu.cn/CRAN/src/contrib:
cannot open URL 'https://mirrors.ustc.edu.cn/CRAN/src/contrib/PACKAGES'

解决办法:

将https换成http,虽然我们浏览器不管是http、https都能打开.

options(repos='http://cran.rstudio.com/')

参考https://stackoverflow.com/questions/25599943/unable-to-install-packages-in-latest-version-of-rstudio-and-r-version-3-1-1

注:重启R后又会变回原来的https的...

然后要改个R studio设置: Tools -> Global Options -> Packages and unchecking the "Use Internet Explorer library/proxy for HTTP" option.

将Use Internet Explorer library/proxy for HTTP选项反勾选

R语言日常笔记(3)R包install失败:cannot open URL_第2张图片

你可能感兴趣的:(R语言日常笔记(3)R包install失败:cannot open URL)