ggmap错误:GeomRasterAnn是用一个不兼容的ggproto版本构建的

时间:2021-03-23 07:00:48

I'm using ggmap, and got the error below:

我使用的是ggmap,得到的误差如下:

Error: GeomRasterAnn was built with an incompatible version of ggproto.
Please reinstall the package that provides this extension.

I've installed the latest version of both ggmap(2.6.1) and ggplot2(2.2.0), but still got the same error.

我已经安装了最新版本的ggmap(2.6.1)和ggplot2(2.2.0),但是仍然有相同的错误。

4 个解决方案

#1


44  

I ran into this problem as well today, and I had to install the GitHub development versions of ggplot2 and ggmap and restart R to get rid of this error:

我今天也遇到了这个问题,我必须安装ggplot2和ggmap的GitHub开发版本,重新启动R以消除这个错误:

devtools::install_github("dkahle/ggmap")
devtools::install_github("hadley/ggplot2")

Before that, I also reinstalled all of the packages mentioned here: https://github.com/thomasp85/ggraph/issues/10

在此之前,我还重新安装了这里提到的所有包:https://github.com/thomasp85/ ggraph/es/10。

Don't know if those reinstalls were necessary, as it was ultimately installing the GitHub version of ggmap that fixed the problem, but thought I'd mention it just in case.

不知道这些重新安装是否必要,因为它最终安装了解决问题的GitHub版本的ggmap,但我还是想说一下以防万一。

Note this problem appears to stem from the recent update to ggplot2 as discussed here: https://github.com/tidyverse/ggplot2/blob/master/NEWS.md#extensions

请注意,这个问题似乎源于这里讨论的对ggplot2的最新更新:https://github.com/tidyverse/ggplot2/blob/master/NEWS.md#扩展

#2


24  

Reinstalling ggmap from source code can fix the problem.

从源代码重新安装ggmap可以解决这个问题。

install.packages("ggmap", type = "source")

#3


5  

The problem persisted for some calculations after following the steps above. Therefore I installed an older version of ggplot2.

按照上面的步骤计算后,这个问题仍然存在。因此我安装了一个旧版本的ggplot2。

library(devtools)
install_version("ggplot2", version = "2.1.0", repos = "http://cran.us.r-project.org")

#4


1  

I came across the same problem today and found that old saved ggmap images (as .RData) couldn't be read using the new ggplot2/ggmap versions (ggmap_2.6.1 & ggplot2_2.2.0) resulting in a ggproto error. Admittedly this did drive me mad for quite sometime. However, when I reran the code and produced saved maps using the new versions of the ggmap and ggplot2 the images were totally readable.

我今天遇到了同样的问题,发现使用新的ggplot2/ggmap版本(ggmap_2.6.1和ggplot2_2.2.0)无法读取旧保存的ggmap图像(如. rdata),从而导致ggproto错误。不可否认,这确实让我有一段时间很抓狂。然而,当我重新运行代码并使用新版本的ggmap和ggplot2生成保存的地图时,这些图像是完全可读的。

At this stage my suggestion is to rerun the code for any ggmap images you want to continue to access (preferred), or alternatively reinstall older versions of ggmap and ggplot2.

在这个阶段,我的建议是重新运行您希望继续访问的任何ggmap映像的代码(首选),或者重新安装旧版本的ggmap和ggplot2。

#1


44  

I ran into this problem as well today, and I had to install the GitHub development versions of ggplot2 and ggmap and restart R to get rid of this error:

我今天也遇到了这个问题,我必须安装ggplot2和ggmap的GitHub开发版本,重新启动R以消除这个错误:

devtools::install_github("dkahle/ggmap")
devtools::install_github("hadley/ggplot2")

Before that, I also reinstalled all of the packages mentioned here: https://github.com/thomasp85/ggraph/issues/10

在此之前,我还重新安装了这里提到的所有包:https://github.com/thomasp85/ ggraph/es/10。

Don't know if those reinstalls were necessary, as it was ultimately installing the GitHub version of ggmap that fixed the problem, but thought I'd mention it just in case.

不知道这些重新安装是否必要,因为它最终安装了解决问题的GitHub版本的ggmap,但我还是想说一下以防万一。

Note this problem appears to stem from the recent update to ggplot2 as discussed here: https://github.com/tidyverse/ggplot2/blob/master/NEWS.md#extensions

请注意,这个问题似乎源于这里讨论的对ggplot2的最新更新:https://github.com/tidyverse/ggplot2/blob/master/NEWS.md#扩展

#2


24  

Reinstalling ggmap from source code can fix the problem.

从源代码重新安装ggmap可以解决这个问题。

install.packages("ggmap", type = "source")

#3


5  

The problem persisted for some calculations after following the steps above. Therefore I installed an older version of ggplot2.

按照上面的步骤计算后,这个问题仍然存在。因此我安装了一个旧版本的ggplot2。

library(devtools)
install_version("ggplot2", version = "2.1.0", repos = "http://cran.us.r-project.org")

#4


1  

I came across the same problem today and found that old saved ggmap images (as .RData) couldn't be read using the new ggplot2/ggmap versions (ggmap_2.6.1 & ggplot2_2.2.0) resulting in a ggproto error. Admittedly this did drive me mad for quite sometime. However, when I reran the code and produced saved maps using the new versions of the ggmap and ggplot2 the images were totally readable.

我今天遇到了同样的问题,发现使用新的ggplot2/ggmap版本(ggmap_2.6.1和ggplot2_2.2.0)无法读取旧保存的ggmap图像(如. rdata),从而导致ggproto错误。不可否认,这确实让我有一段时间很抓狂。然而,当我重新运行代码并使用新版本的ggmap和ggplot2生成保存的地图时,这些图像是完全可读的。

At this stage my suggestion is to rerun the code for any ggmap images you want to continue to access (preferred), or alternatively reinstall older versions of ggmap and ggplot2.

在这个阶段,我的建议是重新运行您希望继续访问的任何ggmap映像的代码(首选),或者重新安装旧版本的ggmap和ggplot2。