【发布时间】:2020-03-27 03:51:52
【问题描述】:
我已经尝试了在 stackoverflow 上看到的主要修复,但没有运气:
- 关闭“使用安全下载方法”
- 将主 CRAN 存储库更改为全局
- 卸载/重新安装 R
Warning in install.packages :
unable to access index for repository http://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6:
cannot open URL "http://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES"
有什么想法吗?这一切都是在尝试安装 pdftools(它本身与 pkgconfig 存在问题)之后开始的。
编辑: 这是完整的代码块。它设法从源下载,但随后给出零退出状态
install.packages("ggplot2")
Installing package into ‘/Users/jackshaw/Library/R/3.6/library’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository https://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.6:
cannot open URL 'https://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.6/PACKAGES'
installing the source package ‘ggplot2’
trying URL 'https://cloud.r-project.org/src/contrib/ggplot2_3.3.0.tar.gz'
Content type 'application/x-gzip' length 3031461 bytes (2.9 MB)
==================================================
downloaded 2.9 MB
[1] "R PROFILE LOADED"
The downloaded source packages are in
‘/private/var/folders/c1/5c3yn_tx2fq7nrcjs_kn637r0000gn/T/RtmpjcV10X/downloaded_packages’
Warning message:
In install.packages("ggplot2") :
installation of package ‘ggplot2’ had non-zero exit status
【问题讨论】:
-
您似乎由于某种原因无权访问存储库。您检查过防火墙、vpn 等设置吗?您是否尝试过从终端安装(例如,
RScript -e "install.packages('dplyr', repos = 'http://cran.rstudio.com/')"?或者尝试一些不同的镜像:cran.r-project.org/mirrors.html -
@JBGruber 感谢您的帮助!是的,检查了防火墙/vpn。从终端安装不起作用,不同的镜像也没有。
标签: r package installation