Error: 'StatIdentity' is not an exported object from 'namespace:ggplot2' when calling ggmap in R [duplicate]
Asked Answered
V

1

0

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.

Vestibule answered 28/1, 2016 at 1:33 Comment(3)
What is your version of ggplot2 and how old are the tutorials you are following. Some changes have been introduced in the version 2.0.0 of ggplot2, possibly making the tutorials obsolete.Barm
I have ggplot2 2.0.0, but now that you mention it the tutorials are fairly old. Do you have any idea how I could clean it up and make it work?Vestibule
Please provide some data (membershipClean)Grubbs
M
2

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

Madriene answered 4/3, 2016 at 11:41 Comment(2)
I had the same problem and this worked for me as well, thanks!Forrer
The newer version of install_github wants install_github('dkahle/ggmap').Shopworn

© 2022 - 2024 — McMap. All rights reserved.