R安装包遇到无法在貯藏處读写索引的报错(镜像问题)

目录

一、报错

二、解决


一、报错

在安装R包“ggalt”时,ggplot2有时也会出现这样的问题。这就是出现了镜像错误。遇到 “cannot open URL”

报错如下:

> install.packages("ggalt")
Warning in install.packages :
  无法在貯藏處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 :
  无法在貯藏處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 :
  package ‘ggalt’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
Warning in install.packages :
  无法在貯藏處https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/windows/contrib/4.3中读写索引:
  cannot open URL 'https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/windows/contrib/4.3/PACKAGES'

如上所述,无法找到有效的镜像。

二、解决

解决如下:

只需要在:

Tools->Global Options->Packages-> primary CRAN repository 

选择其他的镜像即可,可以选择国内离自己最近的一个。

      

之后再次安装:

> install.packages("ggalt")
还安装相依关系‘proj4’, ‘ash’, ‘maps’

trying URL 'https://mirrors.sustech.edu.cn/CRAN/bin/windows/contrib/4.3/proj4_1.0-13.zip'
Content type 'application/zip' length 6792629 bytes (6.5 MB)
downloaded 6.5 MB

trying URL 'https://mirrors.sustech.edu.cn/CRAN/bin/windows/contrib/4.3/ash_1.0-15.zip'
Content type 'application/zip' length 31924 bytes (31 KB)
downloaded 31 KB

trying URL 'https://mirrors.sustech.edu.cn/CRAN/bin/windows/contrib/4.3/maps_3.4.1.1.zip'
Content type 'application/zip' length 3098701 bytes (3.0 MB)
downloaded 3.0 MB

trying URL 'https://mirrors.sustech.edu.cn/CRAN/bin/windows/contrib/4.3/ggalt_0.4.0.zip'
Content type 'application/zip' length 2357317 bytes (2.2 MB)
downloaded 2.2 MB

程序包‘proj4’打开成功,MD5和检查也通过
程序包‘ash’打开成功,MD5和检查也通过
程序包‘maps’打开成功,MD5和检查也通过
程序包‘ggalt’打开成功,MD5和检查也通过

成功!!!

如有其他问题,欢迎探讨。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

TiYong

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值