1

我正在与平常不同的计算机上工作,因此是第一次安装软件包。尝试安装 ggplot2 导致以下错误。

install.packages("ggplot2")
also installing the dependency ‘withr’

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/withr_2.3.0.tgz'
Warning in install.packages :
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/withr_2.3.0.tgz': HTTP status was '404 Not Found'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/withr_2.3.0.tgz'
Warning in install.packages :
  download of package ‘withr’ failed
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/ggplot2_3.3.2.tgz'
Content type 'application/x-gzip' length 4064530 bytes (3.9 MB)
==================================================
downloaded 3.9 MB

我试过只安装“withr”并得到同样的错误。我尝试手动下载“withr”的旧存储库的 zip 文件并将其解压缩到库文件夹中,但这会出现以下错误。

Error: package or namespace load failed for ‘ggplot2’: .onAttach failed in attachNamespace() for 'ggplot2', details: call: NULL error: package ‘withr’ was installed before R 4.0.0: please re-install it

似乎'withr'的URL被破坏了,目前无法获取包;所以任何依赖它的包也无法安装。有没有其他人经历过这个或找到解决方案?我如何联系 CRAN 并让他们知道链接已失效?

MacOS 版本的链接在这里https://cran.r-project.org/bin/macosx/contrib/4.0/withr_2.2.0.tgz

4

0 回答 0