R包安装失败解决

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

> install.packages("scatterplot3d")

Warning in install.packages :   unable to access index for repository https://cran.rstudio.com/src/contrib:  

cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'

Warning in install.packages :   unable to access index for repository https://cran.rstudio.com/src/contrib:  

cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'

Warning in install.packages :   package ‘scatterplot3d’ is not available (for R version 3.5.1)

Warning in install.packages :   unable to access index for repository https://cran.rstudio.com/bin/windows/contrib/3.5:  

cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/PACKAGES'

Warning: unable to access index for repository https://cran.rstudio.com/src/contrib:   cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'


> update.packages()

Warning: 无法在貯藏處https://cran.rstudio.com/src/contrib中读写索引:   cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES' Warning: unable to access index for repository https://cran.rstudio.com/src/contrib:   cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'

Warning: unable to access index for repository https://cran.rstudio.com/src/contrib:   cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'

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

 > install.packages("scatterplot3d")

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.5/scatterplot3d_0.3-41.zip' Content type 'application/zip' length 338005 bytes (330 KB) downloaded 330 KB

package ‘scatterplot3d’ successfully unpacked and MD5 sums checked The downloaded binary packages are in     C:\Users\Administrator\AppData\Local\Temp\Rtmpumb3sX\downloaded_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.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • web服务器收到客户端的HTTP请求,会针对每一次请求分别创建用于一个代表请求的 request对象,和代表性响应...
    前端菜菜1号阅读 858评论 0 0
  • (31)oracle当中存储过程和存储函数的区别 (32)oracle当中如何实现主键自增,mysql当中呢 (3...
    peiyuchn阅读 884评论 0 0
  • 最新无线网络破解安全检测软件密钥恢复教程 测试可用 我不是学电脑专业 我可以操作吗 操作简单吗?我只能说,我也是业...
    鬼幽影阅读 1,547评论 0 0
  • NSO与Facebook:由间谍软件引发的爱恨情仇?去年,Facebook旗下的WhatsApp控告以色列间谍软件...
    溪边的墓志铭阅读 1,046评论 0 0
  • 每日一我 早起金刚芭比还是起来了,还是紫薯馒头 走起。踏实稳稳的满足感在两小时的早习, 丰盛的早餐里。早上安静的时...
    sophietyl阅读 994评论 0 0