View source: R/ei_preprocessing.R
dedupe_precincts | R Documentation |
Removes any rows in the dataset that are fully duplicated. If necessary, adds ' duplicates' column indicating where precincts appear duplicated, for manual inspection by the user
dedupe_precincts(data, id_cols, verbose = TRUE)
data |
A data.frame() object containing precinct-level turnout data by race and candidate |
id_cols |
The name or index of the column in the data containing unique precinct identifiers. Can pass multiple column names or indices in a vector if precincts are identified over multiple columns (eg. c("precinctid", "countyid")). |
verbose |
A boolean. If true, messages are returned describing actions taken by the function. |
A new dataframe without duplicated rows, and (if any) a boolean column identifying duplicated precincts for further investigation.
Ari Decter-Frain <agd75@cornell.edu>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.