【问题标题】:Error loading tidyverse after fresh install - R (loadNamespace, broom, backports)全新安装后加载 tidyverse 时出错 - R (loadNamespace, broom, backports)
【发布时间】:2020-07-01 22:20:27
【问题描述】:

我刚刚将 R 更新到 4.0.2 版,并将 RStudio Desktop 更新到 1.3.959 版。如下面的代码所示,在似乎成功安装后,我无法加载 tidyverse。但是, data.table 安装和加载非常好。这个事情谁有经验?谢谢!

来自控制台的代码(tidyverse 错误):

> install.packages('tidyverse')
Installing package into ‘C:/Users/iangm/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘RColorBrewer’, ‘scales’, ‘dplyr’, ‘ggplot2’

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/RColorBrewer_1.1-2.zip'
Content type 'application/zip' length 55583 bytes (54 KB)
downloaded 54 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/scales_1.1.1.zip'
Content type 'application/zip' length 560984 bytes (547 KB)
downloaded 547 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/dplyr_1.0.0.zip'
Content type 'application/zip' length 1302777 bytes (1.2 MB)
downloaded 1.2 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/ggplot2_3.3.2.zip'
Content type 'application/zip' length 4068169 bytes (3.9 MB)
downloaded 3.9 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/tidyverse_1.3.0.zip'
Content type 'application/zip' length 440050 bytes (429 KB)
downloaded 429 KB

package ‘RColorBrewer’ successfully unpacked and MD5 sums checked
package ‘scales’ successfully unpacked and MD5 sums checked
package ‘dplyr’ successfully unpacked and MD5 sums checked
package ‘ggplot2’ successfully unpacked and MD5 sums checked
package ‘tidyverse’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\iangm\AppData\Local\Temp\RtmpkNazQW\downloaded_packages
> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’:
 .onLoad failed in loadNamespace() for 'broom', details:
  call: loadNamespace(name)
  error: there is no package called ‘backports’

来自控制台的代码(data.table 成功):

> install.packages('data.table')
Installing package into ‘C:/Users/iangm/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/data.table_1.12.8.zip'
Content type 'application/zip' length 2325868 bytes (2.2 MB)
downloaded 2.2 MB

package ‘data.table’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\iangm\AppData\Local\Temp\RtmpkNazQW\downloaded_packages
> library(data.table)
data.table 1.12.8 using 2 threads (see ?getDTthreads).  Latest news: r-datatable.com

【问题讨论】:

    标签: r tidyverse


    【解决方案1】:

    backports 包可能有问题:尝试重新安装该包并再次加载 tidyverse:

    install.packages("backports")
    library(tidyverse)
    

    如果这不起作用,则在早期的 R 主要版本(即 3.x)下构建的软件包可能存在问题。尝试使用以下命令重新安装所有软件包:

    update.packages(ask = FALSE, checkBuilt = TRUE)
    

    在此处查看更多信息:

    【讨论】:

    • 感谢您的帮助!安装包backports 帮助我找到了解决方案。在安装backports 时,我不得不在询问我是否要从源代码安装的提示中选择“否”。从源代码安装导致我在上面发布的相同错误。运行library(tidyverse) 然后给出关于包fs 的错误,所以我还必须安装包fs,同样不是来自源代码。
    • @IanMalone 谢谢,太好了,很高兴它对你有用!安装二进制版本的软件包确实似乎是更安全的方式(而不是源代码)。
    猜你喜欢
    • 1970-01-01
    • 2019-08-20
    • 2017-08-18
    • 1970-01-01
    • 2015-10-17
    • 2018-04-21
    • 2023-02-04
    • 1970-01-01
    相关资源
    最近更新 更多