我刚刚升级到新的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平台上的R版本3.2.1和RStudio 0.99.842。有什么想法吗?
编辑:
要求我提供install命令的输出:
> 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