设置zoom = 2时ggmap背景消失了,我该如何解决这个问题?

时间:2016-11-22 22:51:51

标签: r ggplot2 ggmap

我有一个包含三列的简单数据表:region,lat和lon。我的观点来自遍布非洲和欧亚大陆的人口。

我试图在世界地图(卫星图像)上按地区绘制点和颜色代码:

library(ggmap)

map <- get_map(maptype="satellite",c(lon = 40.29236929, lat = 27.51909309),zoom=2)

ggmap(map)
# Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=27.519093,40.292369&zoom=2&size=640x640&scale=2&maptype=satellite&language=en-EN&sensor=false

当我绘制时,我只得到一个灰色背景而不是map from the URL以及以下警告:

Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
3: In min(x) : no non-missing arguments to min; returning Inf
4: In max(x) : no non-missing arguments to max; returning -Inf

我正在运行最新版本的R,我已经更新了包。

如果我将其设置为zoom=3,地图的边缘将完全切断。无论如何,我可以使用zoom=2获取完整的世界地图以使用ggmap吗?也许让它制作一个非方形地图?

0 个答案:

没有答案