Search code examples
rgoogle-mapsggplot2ggmap

Error: 'StatIdentity' is not an exported object from 'namespace:ggplot2' when calling ggmap in R


I'm trying to create a map of board members for my nonprofit using ggmap. I'm located in San Diego so my code is as follows:

mapPoints <- qmap('San Diego, CA', zoom = 10) + 
             geom_point(data = membershipClean, 
                        aes(x = lon, y = lat, stat = "identity", size = Dues.Amount), 
                        alpha = .5)

Where lat and lon are the members' geocoded latitude and longitude respectively, and Dues.Amount is the numeric value by which I want the points scaled. When I run this code it throws the error:

Error: 'StatIdentity' is not an exported object from 'namespace:ggplot2'"

I can't find anyone else online who is having the same problem. I'm a new user of ggmap but I am following the tutorials I've found online pretty much line by line, so I'm kind of at a loss.


Solution

  • I had the same problem. It is fixed in the dev version of ggmap. Install it using devtools:

    library(devtools)
    install_github('ggmap','dkahle')
    

    Restart session, load packages, and it should work