1

ggmap looks like an excellent package, based on a paper published by David Kahle and Hadley Wickham, "ggmap: Spatial Visualization with ggplot2", The R Journal Vol. 5/1, June 2013, https://journal.r-project.org/archive/2013-1/kahle-wickham.pdf I am using the code published in this article to learn about the package and compare it to RShiny leaflet maps. I started two lines of code on the second page of the article in pdf format, just above Figure 2. There is no formal list of library() requirements, so I used the two most obvious:

library(ggplot2)
library(ggmap)
murder <- subset(crime, offense == "murder")
qmplot(lon, lat, data=murder, colour=I('red'),
       size=I(3), darken = 0.3)

The error (in red) followed immediately:

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

This looks like a more serious problem than missing a package request, but I may have missed something. Searches using this error statement are not providing any solutions that helped for my case. I have updated all of my R packages, and nothing changed.

Paul M
  • 677
  • 1
  • 8
  • 15
  • try [this answer](http://stackoverflow.com/a/40644348/5977215) in relation to [this issue](https://github.com/dkahle/ggmap/issues/122) – SymbolixAU Jan 30 '17 at 23:56
  • So far, I have done the first two commands: devtools::install_github("dkahle/ggmap") devtools::install_github("hadley/ggplot2") and this produces a different error: Error in get("f", environment(CoordMap$train)) : object 'f' not found I will be moving down the list, but this seems like a good starting point. – Paul M Jan 31 '17 at 00:27
  • Thank You! I finally got this to work. I hope that these are changes which will eventually migrate to standard versions? – Paul M Jan 31 '17 at 04:01
  • 1
    Might be worth detailing your process as an answer – SymbolixAU Jan 31 '17 at 04:06

2 Answers2

1

I finally solved the issue by following every one of the suggestions contained in the links submitted by SymbolixAU. I do not have a complete record of the sequence, but the final step was to move to an older version of ggplot2.

This is an excellent StackOverflow conversation on the same problem, which contains a number of steps. This offers a list of 10 changes. A number of these steps contained its own challenges. The command

devtools::install_github('thomasp85/ggraph')

generated a number of errors. Every one of the errors identified an additional package I had to download. Sorry, but I do not have a list, but I would expect the list to vary across different users.

An ideal solution may have been to work on a number of independent computers and compare possible solutions. I downloaded so many R packages last night that I doubt that all of them were really necessary or helpful.

At this point, several hours of work have enabled me to run two lines of ggmap code from the article. I will try going further, but I cannot promise that the problem is completely solved. One alternative is to set ggmap aside and wait 2-3 months for other programmers to find a better long term solution. We will see.

Community
  • 1
  • 1
Paul M
  • 677
  • 1
  • 8
  • 15
0

I also followed the steps detailed here and got stuck on the Error in get("f", environment(CoordMap$train)) : object 'f' not found message for a while. Strangely the thing that solved this for me was this command:

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