Creates a block or precinct level dataset from DRA csv output.

dra2r(dra, state, precincts, epsg = 3857)

Arguments

dra

The path to an exported csv or a dataframe with columns GEOID20 and District, loaded from a DRA export.

state

the state postal code of the state

precincts

an sf dataframe of precinct shapes to link the output to

epsg

numeric EPSG code to planarize to. Default is 3857.

Value

sf dataframe either at the block level or precinct level

Examples

if (FALSE) {
# Needs Census Bureau API
# dra_utah_test is available at https://bit.ly/3c6UDKk
blocklevel <- dra2r('dra_utah_test.csv', state = 'UT')
}