Description Usage Arguments Value Examples
View source: R/plot_cantonalvotes.R
plot_cantonalvotes
plots the results of cantonal votes in a choropleth map using ggplot2.
1 2 3 4 5 6 7 8 9 | plot_cantonalvotes(
votedate = NULL,
vote_id = NULL,
geolevel = "municipality",
measure = "result",
standardize = T,
language = "DE",
theme = "srf"
)
|
votedate |
date of the ballot. Default: most recent ballot available. |
vote_id |
id of the vote. Default: first id mentioned in the data set. |
geolevel |
geographical level. Options: district", "municipality" or "zh_counting_districts". |
measure |
measure to color the administrative units. Options: "result" for the yes vote share or "turnout" for the voter turnout of a given vote. |
standardize |
if |
language |
defines the language. Options: "DE" for German, "FR" for French, "IT" for Italian or "RM" for Romansh. |
theme |
defines basic appearance of the map. Five options are available: "srf" for a theme inspired by the plots of Swiss Radio and Television, and "A" to "E" for the viridis color scales magma, inferno, plasma, viridis and cividis. |
a ggplot object
1 2 3 4 5 | # Plot the most recent cantonal vote
plot_cantonalvotes()
# Plot a specific cantonal vote
plot_cantonalvotes(votedate = "2020-02-09", vote_id = 104945)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.