Getting an error installing R package “withr” as a dependency for “ggplot2”. How can I fix this?

拈花ヽ惹草 提交于 2021-01-28 18:54:31

问题


I'm working on a different computer than usual and so installing packages for the first time. Trying to install ggplot2 resulted in the following error.

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

I've tried install just "withr" and get the same error. I've tried manually downloading the zip file of an older repo for "withr" and unpacking it in the library folder but that gives the following error.

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

It seems that the URL for 'withr' is simply broken and there is no way to get the package at the moment; so any packages that depend on it also cannot be installed. Has any else experienced this or found a solution? How can I contact CRAN and let them know the link is dead?

Link for the MacOS version is here https://cran.r-project.org/bin/macosx/contrib/4.0/withr_2.2.0.tgz

来源:https://stackoverflow.com/questions/64050756/getting-an-error-installing-r-package-withr-as-a-dependency-for-ggplot2-how

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!