美文网首页
R包安装失败解决

R包安装失败解决

作者: 果果爸_2019 | 来源:发表于2020-04-09 18:52 被阅读0次

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.

相关文章

网友评论

      本文标题:R包安装失败解决

      本文链接:https://www.haomeiwen.com/subject/prlhmhtx.html