Description Usage Arguments Value Examples
View source: R/canton_json_to_dfr.R
canton_json_to_dfr
tranforms a single results json for a selected cantonal votedate into a tibble.
1 2 3 4 5 6 7 | canton_json_to_dfr(
votedate = NULL,
geolevel = "municipality",
dataurl = NULL,
index = NULL,
call_res
)
|
votedate |
date of the ballot. Default: most recent ballot available. |
geolevel |
geographical level for which the results should be loaded. Options: "canton", "district" or "municipality". |
dataurl |
list of datasets / metadata for the given dataset and its resources OR url of the dcat dataset on opendata.swiss |
index |
selection by index of the resource (last published = 1). |
call_res |
result of a previous call to the base API. Optional argument. |
a tibble containing the results
1 2 3 4 5 | # Get and transform the json for the most recent vote
results <- canton_json_to_dfr()
# Get and transform the json for a single votedate at counting district level
canton_json_to_dfr(votedate = "2020-02-09", geolevel = "zh_counting_districts")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.