Skip to content

Instantly share code, notes, and snippets.

@hafen
Last active June 1, 2018 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hafen/6e4aaad6ca91bf7b30303ad7f5ebc3c5 to your computer and use it in GitHub Desktop.
Save hafen/6e4aaad6ca91bf7b30303ad7f5ebc3c5 to your computer and use it in GitHub Desktop.
library(geofacet)
# get Connecticut county boundaries from USAboundaries package
counties <- USAboundaries::us_counties(states = "connecticut")
# convert to SpatialPolygonsDataFrame
# (will be more tolerant of different spatial types in the future)
counties <- as(counties, "Spatial")
# remove unneeded columns
counties@data <- counties@data[, c("countyfp", "name")]
# this gives a good initial approximation
grd <- grid_auto(counties, seed = 1234)
# this allows further tweaking and submission
grid_design(grd, label = "name")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment