本文介绍了错误:在R中调用ggmap时,"StatIdentity"不是从"namespace:ggplot2"导出的对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用ggmap为非营利组织创建董事会成员图.我位于圣地亚哥,所以我的代码如下:

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)

其中latlon分别是成员的地理编码纬度和经度,而Dues.Amount是要缩放点的数值.当我运行此代码时,它将引发错误:

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:

我在网上找不到其他遇到相同问题的人.我是ggmap的新用户,但我正在逐行跟踪网上找到的教程,所以我有点茫然.

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.

推荐答案

我遇到了同样的问题.它在ggmap的开发版本中已修复.使用devtools安装它:

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

这篇关于错误:在R中调用ggmap时,"StatIdentity"不是从"namespace:ggplot2"导出的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 21:15