# NOT RUN {
# }
# NOT RUN {
library(prettymapr)
# use as a backdrop for geographical data
cities <- geocode(c("Halifax, NS", "Moncton, NB", "Montreal QC"))
ggplot(cities, aes(lon, lat, shape = query)) + geom_osm() +
geom_point() + coord_map()
# use ggosm() shorthand
ggosm() + geom_point(aes(lon, lat), cities)
# use on its own with a bounding box
ggosm(searchbbox("vermont, USA"))
# use alternative map types (see rosm::osm.types())
ggosm(type = "stamenwatercolor") + geom_point(aes(lon, lat), cities)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab