Skip to content

Instantly share code, notes, and snippets.

@corynissen
Created November 25, 2013 15:52
Show Gist options
  • Select an option

  • Save corynissen/7643490 to your computer and use it in GitHub Desktop.

Select an option

Save corynissen/7643490 to your computer and use it in GitHub Desktop.
overlay shapefile on a ggmap
shapefile <- readOGR("chicago_city_shapefiles", "City_Boundary")
shapefile.converted <- spTransform(shapefile, CRS("+proj=longlat +datum=WGS84"))
p3 <- p2 + geom_polygon(aes(x = long, y = lat, group=group), alpha=.2, fill="black",
data = shapefile.converted) +
coord_cartesian(xlim=c(-87.96, -87.5), ylim=c(41.62, 42.05))
ggsave(plot=p3, "foodborne_p3.png", height=5, width=5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment