ggmap呈现空白地图

时间:2016-11-27 07:15:14

标签: r ggmap

我试图在地图上绘制几个点。但我得到一张空白地图,上面只有红色标记的点。地图缺失

以下代码是可转录的

library(maps)
library(mapdata)
library(ggplot2)
library(ggmap)

lon <- c(-122.1817252,-119.4179324,-95.7128910,-71.0588801,-81.0348144)
lat <- c(37.452960,36.778261,37.090240,42.360082,34.000710)

all_places_geocoded <- data.frame(lon,lat)

gc <- geocode('australia')
center <- as.numeric(gc)

map <- get_googlemap(location = center,maptype = "roadmap", zoom=1)

ggmap(map) + 
  geom_point(data = all_places_geocoded, color = "red3", size = 1)

0 个答案:

没有答案