Download a state file from the Harvard Election Data Archive and return it as
an sf object. Some states require special handling because the source files
differ in format or level of geography.
get_heda(state, path = tempdir(), epsg = 3857, ...)Two-letter state abbreviation.
Directory used for extracted files. Defaults to tempdir().
numeric EPSG code to planarize to. Default is 3857.
Additional arguments passed to sf::read_sf().
sf tibble containing the requested HEDA dataset
Most states are distributed as zipped shapefiles. California is stored differently and is aggregated here to 2010 tracts. Some states are shipped as loose shapefile components rather than zip archives. If the source file has no CRS metadata, the function assumes EPSG 4140 before optionally reprojecting.
The function currently returns the raw source column names because internal name cleaning is disabled in the implementation.
if (FALSE) { # Sys.getenv("DATAVERSE_KEY") != ""
shp <- get_heda('ND')
}