election_results: Fetch election results in tidy format

Description Usage Arguments Value Examples

View source: R/election-data-helpers.R

Description

Fetches election results in the format that you probably want for plotting. For more complex operations, use joins of results, ridings, and/or boundaries. Note that in elections before 1968 there was more than one MP elected from several ridings.

Usage

1
2
3
4
5
election_results(
  years = election_years(),
  provinces = election_provinces(),
  results = c("Elected", "Defeated")
)

Arguments

years

One or more election_years() to include in the data

provinces

One or more election_provinces() (or terretories) include in the data. The order of provinces is kept in the data by making the province variable a factor.

results

One or both of "Elected" and/or "Defeated" to include in the data

Value

A tibble::tibble() of a join between results and ridings.

Examples

1
2
3
4
election_results(
  years = 2015:2019,
  provinces = c("Nova Scotia", "New Brunswick")
)

paleolimbot/electionca documentation built on Jan. 23, 2020, 4:36 p.m.