Skip to contents

Retrieve vote results

Download federal and cantonal vote results from opendata.swiss.

get_nationalvotes()
Get national results and counting status in real time or for selected dates or a time range in the past
get_cantonalvotes()
Get cantonal results and counting status in real time or for selected dates or a time range in the past
available_votedates()
Get a vector of available vote dates via `get_nationalvotes` and `get_cantonalvotes“

Parse JSON

Convert raw API JSON to tidy data frames.

swiss_json_to_dfr()
Transform an opendata.swiss national results json into a tibble
canton_json_to_dfr()
Transform a opendata.swiss cantonal results json into a tibble

Geodata & maps

Retrieve administrative boundaries and plot vote result maps.

get_geodata()
Get Swiss Geodata
plot_nationalvotes()
Plot National Votes
plot_cantonalvotes()
Plot Cantonal Votes

Swissvotes database

Access the Swissvotes database and post-vote survey data.

get_swissvotes()
Download additional data collected by annee politique suisse (the complete SwissVotes-Database)
get_poll()
Download poll data collected after a national vote by gfs.bern and the political science departements of the universities of Berne, Zurich, and Geneva.

Analysis

similar_votes()
Obtain similarities a vote result shares with other votes

Data

keys
Merge data