knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
This package has a few functions that I use regularly to process election data:
elec_find_winner -- For a data frame with city/precinct/place results by row, each candidate/issue raw vote total in a separate column. This function finds the candidate/issue/column name with the highest total in each row, returning the column name. It accounts for ties.
elec_pcts_by_row -- Also for a data frame with city/precinct/place results by row, each candidate/issue raw vote total by column. This function calculates the percent for each candidate/issue in each row and adds intuitively named percent columns to the data frame.
IN PROGRESS:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.