我正在尝试使用 R googleway 分析来自 NY Open Data 的犯罪记录。我想在纽约城市地图上添加区域多边形和犯罪圈。但是,即使我将总犯罪点数减少到 19k,我仍然无法加载创建的地图。请看下面的代码。
map_key = "api_key
ggmap = google_map(location = c(mean(40.730610), mean(-73.935242)), zoom =
11, key = map_key)
ggmap %>% add_polygons(data = nypp_df_gg, lat = "lat", lon = "lon", id =
"ID", pathId = "pathID") %>% add_circles(lat = "Latitude", lon =
"Longitude", data = data.frame(NYPD_complaint_bf2006))
如果我将行限制为 500 行,它确实有效。我可以知道是否有一种方法可以可视化大于 1MM 的大型观察结果吗?我尝试使用 add_heatmap 但也没有任何运气。
有效的代码是
ggmap %>% add_polygons(data = nypp_df_gg, lat = "lat", lon = "lon", id =
"ID", pathId = "pathID") %>% add_circles(lat = "Latitude", lon =
"Longitude", data = data.frame(NYPD_complaint_bf2006[1:500,]))