Mapping package updates

by on April 1, 2017

I’ve been in a bit of a programming haze for the last few days after discovering that the code I wrote a year ago was not working very well in the rosm and prettymapr packages. In addition, a project I had worked on a few months ago needed some work, and for some reason I decided that the last few days were the days to get things done. The READMEs for rosm and prettymapr, and ggspatial give all the details, but most of it can be summed up in the following few-liner:

library(prettymapr)
library(ggspatial)

places <- geocode(c("halifax, ns", "moncton, nb", "yarmouth, ns", "wolfville, ns"))
ggplot(places, aes(lon, lat, shape = query)) + 
  geom_osm() + geom_point() + 
  coord_quickmap()

It turns out extending geometries and stats in ggplot is actually quite complex, but it seems this particular iteration of ggspatial does the trick. Now back to the real world…

Leave a Reply

WP Facebook Like Send & Open Graph Meta powered by TutsKid.com.