I'm using ggmap to grab Washington DC and I have a shapefile that I downloaded from here:
library(ggplot2)library(ggmap)library(maptools)dc = get_map(location = 'DC', zoom = 12)nhbds = readShapePoly("Census_Tracts_-_2010.shp")ggmap(dc) + geom_polygon(aes(x = long, y = lat, group = group), data = nhbds, alpha = 0.8, color = "black", size = 0.2)
I'd like to clip the map to the borders of the city only, getting rid of Virginia and Maryland. And I don't actually want to overlay the tracts.
Any simple ways to do this? Here's a nice map that looks like what ultimately I want to accomplish:
أكثر...
library(ggplot2)library(ggmap)library(maptools)dc = get_map(location = 'DC', zoom = 12)nhbds = readShapePoly("Census_Tracts_-_2010.shp")ggmap(dc) + geom_polygon(aes(x = long, y = lat, group = group), data = nhbds, alpha = 0.8, color = "black", size = 0.2)

I'd like to clip the map to the borders of the city only, getting rid of Virginia and Maryland. And I don't actually want to overlay the tracts.
Any simple ways to do this? Here's a nice map that looks like what ultimately I want to accomplish:

أكثر...