gpt4 book ai didi

r - 无法在 R 中加载新的 ggplot2

转载 作者:行者123 更新时间:2023-12-02 02:46:19 25 4
gpt4 key购买 nike

我刚刚升级到新的 ggplot2 包 (2.0.0),当我尝试加载它时不断收到错误。

> library(ggplot2)
Error in get(method, envir = home) :
lazy-load database 'C:/Users/<blahblahblah>/Documents/R/win-library/3.2/ggplot2/R/ggplot2.rdb' is corrupt
In addition: Warning messages:
1: package ‘ggplot2’ was built under R version 3.2.3
2: In .registerS3method(fin[i, 1], fin[i, 2], fin[i, 3], fin[i, 4], :
restarting interrupted promise evaluation
3: In get(method, envir = home) :
restarting interrupted promise evaluation
4: In get(method, envir = home) : internal error -3 in R_decompress1
Error: package or namespace load failed for ‘ggplot2’

我能够在 R 中加载其他包,例如 dplyr,这意味着我的“R_decompress1”函数不应该有任何问题,因为所有包都需要该函数。然后我认为 CRAN 上的二进制文件可能已损坏(不太可能,但很容易检查)。我使用 github 页面上建议的方法从当前源安装。

> devtools::install_github("hadley/ggplot2")

干净地完成后,我收到以下错误(与之前类似)

> library(ggplot2)
Error in get(Info[i, 1], envir = env) :
lazy-load database 'C:/Users/jclutter/Documents/R/win-library/3.2/ggplot2/R/ggplot2.rdb' is corrupt
In addition: Warning message:
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
Error: package or namespace load failed for ‘ggplot2’

我正在 Windows 7 平台上使用 RStudio 0.99.842 运行 R 版本 3.2.1。有什么想法吗?

编辑:

我被要求提供安装命令的输出:

> remove.packages('ggplot2')
Removing package from ‘C:/Users/jclutter/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
> install.packages('ggplot2')
Installing package into ‘C:/Users/jclutter/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/ggplot2_2.0.0.zip'
Content type 'application/zip' length 1977623 bytes (1.9 MB)
downloaded 1.9 MB

package ‘ggplot2’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\jclutter\AppData\Local\Temp\1\RtmpAHUju4\downloaded_packages

最佳答案

重新安装 ggplot2 后应重新启动 R。请参阅以下 Stackoverflow 链接,因为这是一个类似的问题

Error in fetch(key) : lazy-load database

关于r - 无法在 R 中加载新的 ggplot2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34593159/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com