安装R包报错unable to access index for repository

改变了工作地点后,安装R包时出现报错

install.packages("VennDiagram")
#Warning: unable to access index for repository https://mirrors.tongji.edu.cn/CRAN/bin/macosx/contrib/4.1:
#  cannot open URL 'https://mirrors.tongji.edu.cn/CRAN/bin/macosx/contrib/4.1/PACKAGES'

其实改变镜像就可以了,要选择离自己近的镜像

options(repos=structure(c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/")))

再进行安装就可以了

install.packages("VennDiagram")
#trying URL 'https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/macosx/contrib/4.1/VennDiagram_1.7.1.tgz'
#Content type 'application/octet-stream' length 247726 bytes (241 KB)
#==================================================
#downloaded 241 KB
#The downloaded binary packages are in  #/var/folders/1h/v10vvcv51b969_64czytxlgw0000gn/T//Rtmp8fjMB8/downloaded_packages

其他安装方法见总结一下手动安装R包

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

推荐阅读更多精彩内容