## Not run: ------------------------------------
# # Example: get ZCTAs that intersect the Memphis, TN urbanized area
#
# library(tigris)
# library(rgeos)
# library(sp)
#
# df <- zctas(cb = TRUE, starts_with = c("37", "38", "72"))
#
# uas <- urban_areas()
#
# memphis_ua <- uas[grep("Memphis", uas$NAME10), ]
#
# mem_zcta <- df[as.vector(gIntersects(df, memphis_ua, byid = TRUE)), ]
#
# plot(mem_zcta)
#
## ---------------------------------------------
Run the code above in your browser using DataLab