我正在使用ggmap在 Map 上绘制一些点 . 这是错误消息:
Removed 10 rows containing missing values (geom_point).
这是我的代码:
library(ggmaps)
library(maps)
library(DataComputing)
map <- get_map(location='san francisco', zoom=12, maptype = 'terrain', source = 'google', color = 'color')
ggmap(map) %>%
+ geom_point(aes(x=longitude, y=latitude, colour = as.numeric(total)), data=district_crimes) %>%
+ scale_color_gradient(low='beige', high='blue')
Proof that longitude and latitude are numeric.
怎么得分积分?谢谢 .
1 回答
@timfaber的建议是对的 . 经度位于x轴上,纬度位于y轴上,如下图中的轴标签所示:
因此,在 Map 上绘制点的正确方法是: