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)
A new dataframe without duplicated rows, and (if any) a boolean column identifying duplicated precincts for further investigation.
A data.frame() object containing precinct-level turnout data by race and candidate
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")).
A boolean. If true, messages are returned describing actions taken by the function.
Ari Decter-Frain <agd75@cornell.edu>