Learn R Programming

nzelect (version 0.4.0)

GE2014: General Election Results 2014

Description

New Zealand 2014 general election results by voting place

Usage

GE2014

Arguments

Format

A data frame with 136,195 rows and 7 variables.

Details

  • ApproxLocation. Approximate location of voting place

  • VotingPlace. Exact location of voting place

  • Party. Party voted for (party vote) or party of candidate voted for (candidate vote)

  • Votes. Number of votes

  • Electorate. Electorate in which voters were enrolled. Note that this is not necessarily the physical location of the VotingPlace, so VotingPlace and Electorate have a many to many relationship

  • VotingType. 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 of Parliament.

  • Candidate. If VotingType == "Candidate", the name of the candidate; otherwise NA

GE2014 is deprecated; please use nzge instead - it has results back to 2002 and is the one we will update in future.

See Also

Locations2014

Examples

Run this code
# NOT RUN {
# the following matches the results published at
# http://www.electionresults.govt.nz/electionresults_2014/e9/html/e9_part1.html
library(tidyr)
library(dplyr)
GE2014 %>%
    mutate(VotingType = paste0(VotingType, "Vote")) %>%
    group_by(Party, VotingType) %>%
    summarise(Votes = sum(Votes)) %>%
    spread(VotingType, Votes) %>%
    select(Party, PartyVote, CandidateVote) %>%
    ungroup() %>%
    arrange(desc(PartyVote))
# }

Run the code above in your browser using DataLab