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.

  • 13
    点赞
  • 33
    收藏
    觉得还不错? 一键收藏
  • 14
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值