README.md

AustralianElections

Travis build
status

AustralianElections is a collection of datasets related to Australian elections. The datasets are:

The datasets are up-to-date as of 10 September 2019.

If you have suggestions on how I could improve the datasets, or corrections, please don’t hesitate to get in touch.

Installation

You can install this package from GitHub with:

# install.packages("devtools")
devtools::install_github("RohanAlexander/AustralianElections")

Example

This is an example of how to load the data:

devtools::install_github("RohanAlexander/AustralianElections")

byelections <- AustralianElections::get_auselection("byelections")
elections <- AustralianElections::get_auselection("elections")
parliaments <- AustralianElections::get_auselection("parliaments")
voting_data <- AustralianElections::get_auselection("voting_data")
voting_data_ids <- AustralianElections::get_auselection("voting_data_with_ids")

Alternatively, you can load only a specific year:

voting_data_2016 <- AustralianElections::get_auselection("voting_data", year = 2016)

Or, a range of years by using a relational operator:

In addition to providing access to these datasets, AustralianElections also provides two pre-filtered datasets based upon the two-party-preferred results and the eventual winner. These datasets by default use the voting_data_with_ids dataset, but can be set to use the voting_data dataset instead.

To call the two-party-preferred dataset you can use:

twopp_ids <- AustralianElections::auselect_twopp()

To call the version based on the voting_data you use:

twopp_noids <- AustralianElections::auselect_twopp(w_ids = F)

The winners dataset works similarly, with the default dataset being voting_data_with_ids while setting w_ids to FALSE will set the base dataset to voting_data.

winners_ids <- AustralianElections::auselect_winners()
winners_noids <- AustralianElections::auselect_winners(w_ids = F)

Dataset details

TBD

TODO

Roadmap

Sources

Acknowledgements

Citation

If you use AustralianElections, please consider citing:

Alexander, Rohan. (2019). AustralianElections: Datasets on Australian Elections. Source: https://github.com/RohanAlexander/AustralianElections.

Author information

Rohan Alexander (corresponding author and repository maintainer) University of Toronto Information Sciences 140 St George St Toronto, ON, Canada Email: rohan.alexander@utoronto.ca



RohanAlexander/AustralianElections documentation built on Dec. 18, 2021, 10:59 a.m.