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

4

53

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

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.

Whitening answered 16/11, 2016 at 21:40 Comment(0)
S
45

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

Slogan answered 16/11, 2016 at 23:45 Comment(3)
Thank you for the tip! Small typo: you are missing a '. It should be devtools::install_github('hadley/ggplot2')Vachil
Thanks! Install the dev version of ggmap solved my problem!Whitening
As of 2017-02-17 I just needed devtools::install_github("dkahle/ggmap") + ggplot2 v2.2.1 (the current version on CRAN).Bargain
I
25

Reinstalling ggmap from source code can fix the problem.

install.packages("ggmap", type = "source")
Intrench answered 25/1, 2017 at 9:55 Comment(0)
V
5

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")
Vachil answered 17/11, 2016 at 9:55 Comment(0)
R
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.

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.

Receptacle answered 24/11, 2016 at 7:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.