Description Usage Arguments Details Value Examples
View source: R/get_cantonalvotes.R
get_cantonalvotes
is one of the two main functions of swissvote package. It allows to retrieve the results and the counting status for national ballots.
1 2 3 4 5 6 | get_cantonalvotes(
geolevel = "municipality",
votedates = NULL,
from_date = NULL,
to_date = NULL
)
|
geolevel |
geographical level for which the results should be loaded. Options: "canton", "district", "municipality" or "zh_counting_districts". |
votedates |
dates of the ballots to be selected. Default: most recent ballot available. Format: "YYYY-MM-DD". |
from_date |
starting point in time from which vote results should be retrieved. Format: "YYYY-MM-DD". |
to_date |
end point in time to which vote results should be retrieved. Format: "YYYY-MM-DD". |
get_cantonalvotes - retrieve vote results for cantonal ballots at district- or municipality level for selected dates or a given date range.
a tibble containing the results
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Select by range
results <- get_cantonalvotes(
geolevel = "district",
from_date = "2019-01-01",
to_date = "2019-12-31"
)
# Select specific votedate(s)
get_cantonalvotes(votedates = "2019-02-10")
# get the results at counting district level
# yields the same result as the municipality level, with the
# exception of Winterthur and Zurich,
# where detailed counting district results are returned instead.
get_cantonalvotes(votedate = "2019-09-22", geolevel = "zh_counting_districts")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.