nzge {nzelect}R Documentation

General Election Results 2002 and onwards

Description

New Zealand general election results by voting place for 2002, 2005, 2008, 2011 and 2014

Usage

nzge

Format

A data frame with 728,602 rows and 9 variables.

Details

Source

http://www.electionresults.govt.nz/electionresults_2014/e9/html/statistics.html

See Also

voting_places

Examples

# 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`))

[Package nzelect version 0.4.0 Index]