get_cantonalvotes: Get cantonal results and counting status in real time or for...

Description Usage Arguments Details Value Examples

View source: R/get_cantonalvotes.R

Description

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.

Usage

1
2
3
4
5
6
get_cantonalvotes(
  geolevel = "municipality",
  votedates = NULL,
  from_date = NULL,
  to_date = NULL
)

Arguments

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".

Details

get_cantonalvotes - retrieve vote results for cantonal ballots at district- or municipality level for selected dates or a given date range.

Value

a tibble containing the results

Examples

 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")

swissdd documentation built on July 17, 2021, 9:06 a.m.