Description Usage Arguments Value Examples
View source: R/data-manipulation.R
Aggregate votes for a geographic unity by political party
1 2 | aggregate_party_votes(data, geography = c("county"),
parties = c("Federalist", "Democratic-Republican"))
|
data |
A data frame returned by |
geography |
The geography to aggregate by for mapping. For instance,
|
parties |
The parties to explicitly keep by name. All other parties,
along with unaffiliated candidates, will be collapsed into |
A data frame with one row for each geographic unit (e.g. for each county) in the data frame. There will be columns for each party, giving their votes recorded and vote percentage, along with the total vote in that geographic unit.
1 2 | votes <- vote_counts("meae.congressional.congress05.ny.county")
aggregate_party_votes(votes)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.