R GG Lat/Long上按城市划分的地图

R GG Lat/Long上按城市划分的地图,r,google-maps,ggmap,R,Google Maps,Ggmap,我正在尝试使用ggmap创建一个地图,该地图在不同城市的坐标上绘制圆圈,并输入一个值作为直径/半径 City Diameter/Radius Atlanta 100000 Chicago 200000 New York 300000 Los Angeles 400000 Miami 500000 我在过去已经做到了这一点,但我必须将城市名称与zipcode数据集进行索引/匹配,该数据集包含大约3000个城市及其lat/long集的列表

我正在尝试使用
ggmap
创建一个地图,该地图在不同城市的坐标上绘制圆圈,并输入一个值作为直径/半径

City         Diameter/Radius
Atlanta      100000
Chicago      200000
New York     300000
Los Angeles  400000
Miami        500000
我在过去已经做到了这一点,但我必须将城市名称与
zipcode
数据集进行索引/匹配,该数据集包含大约3000个城市及其lat/long集的列表。有关聚合数据集,请参见下文:

     Date          city Total.Conversions      lat       long    newdate
1  6/7/15       Chicago            132726 41.85000  -87.65000 2015-06-07
2 6/11/15      New York            118858 40.75074  -73.99653 2015-06-11
3 6/10/15       Houston             98766 40.24185  -80.21445 2015-06-10
4 5/25/15       Atlanta             95496 42.56055  -77.47257 2015-05-25
5  6/8/15        Dallas             93477 41.34558  -75.97596 2015-06-08
6 6/12/15 San Francisco             88536 37.78483 -122.72780 2015-06-12
虽然一开始这似乎是个好主意,但还是有一些数据丢失,总体来说输出不正确。代码和输出如下所示:

map <- get_map(location=c(lon = -98.35, lat = 39.50), zoom = 4, source="google",maptype="roadmap",crop=FALSE)
ggmap(map)
ggmap(map, legend = "none")+geom_point(aes(x = testdata$long, y = testdata$lat), data = testdata, alpha = .7, 
                      color = "darkgreen", size = (testdata$Total.Conversions)/5000)

map-um,城市在某个时候必须转换为lat/lon。所以我过去一直这样做是唯一的方法吗?