Skip to contents

Read in raw data files of a specific Swiss canton

Usage

read_raw_data(
  canton = c("Bern", "Geneva", "Neuchatel"),
  ballot_date,
  specific_datasets = NULL,
  use_cache = TRUE,
  max_cache_age = "7 days"
)

Arguments

canton

The canton of which to read in raw data files.

ballot_date

The ballot date of which to read in raw data files.

specific_datasets

If not NULL, only the specified filenames will be processed. A list with ballot dates as keys and character vectors of specific filenames (without the filetype extension) as values. Setting specific_datasets is only sensible in case of canton = "Geneva" and thus ignored otherwise.

use_cache

Whether or not to return cached results if possible. If FALSE, results are always newly fetched regardless of max_cache_age.

max_cache_age

Duration after which cached results are refreshed (i.e. newly fetched). A valid lubridate duration. Use Inf to disable cache expiry. Only relevant if use_cache = TRUE.

Value

In case of canton = "Geneva", a list with a tibble for each raw data file plus a metadata tibble. Otherwise a single tibble.