Ggmap

From Dave's wiki
Jump to navigation Jump to search

There are two steps to adding a map to a ggplot2 plot with ggmap:

  • Download a map using get_map()
  • Display the map using ggmap()
library(ggmap)
corvallis <- c(lon = -123.2620, lat = 44.5646)

# Get map at zoom level 5: map_5
map_5 <- get_map(location = corvallis, zoom = 5, scale = 1)

# Plot map at zoom level 5
ggmap(map_5)