Failing to load the new ggplot2 in R

2019-06-14 23:18发布

I just upgraded to the new ggplot2 package (2.0.0) and keep getting an error when I try to load it.

> 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’

I am able to load other packages in R, such a dplyr, which means there should not be anything wrong with my "R_decompress1" function as that is needed on all packages. I then thought that the binary on CRAN might be corrupted (unlikely, but an easy thing to check for). I use the suggested method on the github page to install from current sources.

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

After that completed cleanly, I received the following error (similar to the previous)

> 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’

I am running R version 3.2.1 with RStudio 0.99.842 on a Windows 7 platform. Any thoughts?

edit:

I was requested for the output of the install command:

> 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

标签: r ggplot2
1条回答
家丑人穷心不美
2楼-- · 2019-06-14 23:47

You should restart R after re-installing ggplot2. See the following Stackoverflow link as this is a similar problem

Error in fetch(key) : lazy-load database

查看更多
登录 后发表回答