get_precinct | R Documentation |
Get a precinct-level dataset by using dplyr::distinct(.keep_all = TRUE). Thus the rows need to be ordered correctly.
get_precinct(df, precinct_regex = "(RUN DATE|ELECTION ID:)")
df |
a EL155 dataset, read through read_EL155 |
precinct_regex |
regex to identify rows with precinct names. For 2018-11-06, use "PRECINCT (?!TOTAL)". Default should work in ohter cases. |
A dataset keyed by precinct. start_id and end_id refer to the range of the precinct in terms of the row IDs in read_EL155 output. column 'precinct' is is the name portion of the precinct header. 'precinct_id' is the ID of precinct within the county
data(G2016_Dillon_EL155)
dillon_p <- get_precinct(G2016_Dillon_EL155)
wprecinct <- add_precinct(G2016_Dillon_EL155, dillon_p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.