ggmap Error: GeomRasterAnn was built with an incompatible version of ggproto

筅森魡賤 提交于 2019-11-26 22:22:08

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:

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

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.

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

Reinstalling ggmap from source code can fix the problem.

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

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

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

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!