Last active
March 1, 2019 15:26
-
-
Save bradlindblad/8044f2b3100d3cbc7e64e4a496fff847 to your computer and use it in GitHub Desktop.
footprint_polygon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To generate the footprint_polys data | |
footprint_poly <- function() { | |
#' Returns object of class SpatialPolygons of the AgC footprint. | |
#' Utilizes the Tigris:: package. | |
require(tidyverse) | |
require(tigris) | |
require(sf) | |
# Get County Polygons | |
states.raw <- tigris::states() | |
states <- states.raw[states.raw@data$STUSPS %in% c("CA", "OR", "WA"),] | |
states <- sf::st_as_sfc(states) | |
states <- sf::st_union(states) | |
states <- as(states, 'Spatial') | |
return(states) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment