convert_toplevel_totals: Convert a Single Column of Top-level Totals by Precinct

Description Usage Arguments Value

View source: R/precinct_processing_functions.R

Description

This function can be used in situations present in some counties where precinct totals exist that you want to capture separately, like total ballots cast, total registered voters, etc. The function assumes the existence of a "precinct" column with the precinct names, and then asks you to provide the column name (quoted) with the total votes you want to capture. Additionally to match OpenElex formatting the category is listed as the "office": the third argument allows you to provide that value.

Usage

1
convert_toplevel_totals(df, column_with_totals, office_text)

Arguments

df

dataframe with the precinct totals

column_with_totals

quoted name of target column containing the totals to capture (e.g. "total_reg_voters")

office_text

text to fill in the OpenElex office column as per the standard (e.g. "Registered Voters")

Value

formatted dataframe ready to match up with OpenElex column structure


amkessler/precinctsopenelex documentation built on Feb. 5, 2021, 9:27 p.m.