安装R软件包时出错“;用R";作为对“的依赖”;ggplot2";。我怎样才能解决这个问题?

安装R软件包时出错“;用R";作为对“的依赖”;ggplot2";。我怎样才能解决这个问题?,r,ggplot2,devtools,R,Ggplot2,Devtools,我在一台与平常不同的计算机上工作,因此第一次安装了软件包。尝试安装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

我在一台与平常不同的计算机上工作,因此第一次安装了软件包。尝试安装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
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”,但得到了相同的错误。我曾尝试手动下载“withr”的旧repo的zip文件,并将其解压缩到library文件夹中,但出现以下错误

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
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版本的链接在此处

您的MacOS链接不起作用。看起来他们破坏了这个版本。你的MacOS链接不工作。看起来他们破坏了这个版本。