首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误:“tidyverse”中没有名为“reprex”的包或命名空间加载失败

错误:“tidyverse”中没有名为“reprex”的包或命名空间加载失败
EN

Stack Overflow用户
提问于 2021-01-28 16:58:11
回答 1查看 4.8K关注 0票数 1
代码语言:javascript
复制
library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘reprex’

我正在使用这个版本的R版本4.0.3 (2020-10-10),我也试图安装这个库"reprex“,但我有

代码语言:javascript
复制
install.packages("reprex")
also installing the dependency ‘withr’

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/withr_2.4.1.tgz'
Warning in install.packages :
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/withr_2.4.1.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.4.1.tgz'
Warning in install.packages :
  download of package ‘withr’ failed
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/reprex_1.0.0.tgz'
Warning in install.packages :
  cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/reprex_1.0.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/reprex_1.0.0.tgz'
Warning in install.packages :
  download of package ‘reprex’ failed

我有macOs大苏尔

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-01-28 18:03:15

我刚刚在MacOS大苏尔也有同样的问题。它现在确实起作用了。我安装了ggplot2 install.packages("ggplot2"),它也安装了r,这是以前找不到的包。

还安装依赖项“withr”

代码语言:javascript
复制
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/withr_2.4.1.tgz'
Content type 'application/x-gzip' length 205896 bytes (201 KB)
==================================================
downloaded 201 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/ggplot2_3.3.3.tgz'
Content type 'application/x-gzip' length 4068756 bytes (3.9 MB)
==================================================
downloaded 3.9 MB

在那之后,我又安装了tidyverse,问题解决了。

代码语言:javascript
复制
> install.packages("tidyverse")
also installing the dependency ‘reprex’

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/reprex_1.0.0.tgz'
Content type 'application/x-gzip' length 478248 bytes (467 KB)
==================================================
downloaded 467 KB

trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/tidyverse_1.3.0.tgz'
Content type 'application/x-gzip' length 433049 bytes (422 KB)
==================================================
downloaded 422 KB

> library(tidyverse)
── Attaching packages ─────────────────────────────────────────────────────────────────────── tidyverse 1.3.0 ──
✓ ggplot2 3.3.3     ✓ purrr   0.3.4
✓ tibble  3.0.5     ✓ dplyr   1.0.3
✓ tidyr   1.1.2     ✓ stringr 1.4.0
✓ readr   1.4.0     ✓ forcats 0.5.1

我不确定解决方案是否确实安装了ggplot2。这是我第一次使用R. (我在edX上学习数据科学课程)

干杯!

  • Enzo
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65941744

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档