Description Usage Arguments Value Examples
View source: R/plot-election.R
Plots the number of votes or the number of seats as a bar chart. Use
position = "fill"
to visualize vote proportions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | plot_votes(
years = 2006:2019,
provinces = election_provinces(),
x_var = "election_year",
fill_var = "party",
facet_var = NULL,
facet_scales = "fixed",
position = "stack",
n_parties = 5
)
plot_seats(
years = 2006:2019,
provinces = election_provinces(),
x_var = "election_year",
fill_var = "party",
facet_var = NULL,
facet_scales = "fixed",
position = "stack"
)
|
years |
One or more |
provinces |
One or more |
x_var, fill_var |
A variable in |
facet_var |
A variable to use with |
facet_scales |
Scales, most usefully "free" or "fixed". |
position |
A position, most usefully "stack" or "fill". |
n_parties |
The number of parties to include. |
A ggplot2::ggplot()
1 2 | plot_votes()
plot_seats()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.