New Zealand general election results by voting place for 2002, 2005, 2008, 2011 and 2014
A data frame with 728,602 rows and 9 variables.
approx_location. Approximate location of voting place
vorting_place. Description of exact location of voting place
party. Party voted for (party vote) or party of candidate voted for
votes. Number of votes
electorate. Electorate in which voters were enrolled. Note that this
is not necessarily the physical location of the voting_place, so voting_place
and electorate have a many to many relationship
voting_type. Party (proportional representation) or Candidate (first past
the vote). In New Zealand each voter has to vote for both an individual
candidate to represent their electorate, and a party vote for the overall makeup
candidate. If voting_type == "Candidate", the name of the candidate;
election_year. Year of the election.
electorate_number. Number of the electorate.
1 2 3 4 5 6 7 8 9 10 11
# the following matches the results published at # http://www.electionresults.govt.nz/electionresults_2014/e9/html/e9_part1.html library(tidyr) library(dplyr) nzge %>% mutate(voting_type = paste0(voting_type, " vote")) %>% group_by(party, voting_type, election_year) %>% summarise(votes = sum(votes)) %>% spread(voting_type, votes) %>% ungroup() %>% arrange(election_year, desc(`Party vote`))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.