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

為{幸葍}努か 提交于 2020-03-27 06:57:05

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/35051374/error-statidentity-is-not-an-exported-object-from-namespaceggplot2-when-ca

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