Skip to contents

Downloads referendum data from sudd.ch.

Usage

sudd_rfrnds(
  ids_sudd,
  use_cache = TRUE,
  max_cache_age = "1 week",
  quiet = FALSE
)

Arguments

ids_sudd

The referendum identifiers assigned by sudd.ch. Either as a character vector or a data frame containing a column id_sudd. NAs are ignored.

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.

quiet

Whether or not to suppress printing status output from internal processing.

Value

A tibble. The column names are aligned with those of rfrnds() as closely as possible.

About sudd.ch

sudd stands for Suchmaschine für direkte Demokratie (German) and is operated by Beat Müller. Its database content is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0).

See also

Other sudd.ch scraping functions: list_sudd_rfrnds(), list_sudd_territories(), list_sudd_titles()

Examples

rdb::rfrnd(id = "5bbc045192a21351232e596f")$id_sudd |> rdb::sudd_rfrnds()
#> # A tibble: 1 × 30
#>   id_sudd  country_code country_name  is_former_country subnational_entity_code territory_name_de territory_type_de  date        year month   day title_de      
#>   <chr>    <chr>        <chr>         <lgl>             <chr>                   <chr>             <chr>              <date>     <int> <int> <int> <chr>         
#> 1 li012015 LI           Liechtenstein FALSE             NA                      Liechtenstein     unabhängiger Staat 2015-12-13  2015    12    13 Krankenversic…
#> # ℹ 18 more variables: question_type_de <chr>, result_de <chr>, result_status_de <chr>, adoption_requirements_de <list>, electorate_total <int>,
#> #   polling_cards <int>, votes_total <int>, votes_empty <int>, votes_void <int>, votes_invalid <int>, votes_valid <int>, votes_yes <int>, votes_no <int>,
#> #   votes_option_1 <int>, files <list>, remarks <list>, sources <list>, date_last_edited <date>

rdb::rfrnds(quiet = TRUE) |>
  dplyr::filter(country_code == "AT") |>
  rdb::sudd_rfrnds()
#> # A tibble: 5 × 29
#>   id_sudd  country_code country_name is_former_country subnational_entity_code territory_name_de territory_type_de         date        year month   day title_de
#>   <chr>    <chr>        <chr>        <lgl>             <chr>                   <chr>             <chr>                     <date>     <int> <int> <int> <chr>   
#> 1 at012013 AT           Austria      FALSE             NA                      Österreich        unabhängiger Staat        2013-01-20  2013     1    20 Berufsh…
#> 2 at012013 AT           Austria      FALSE             NA                      Österreich        unabhängiger Staat        2013-01-20  2013     1    20 Berufsh…
#> 3 at011994 AT           Austria      FALSE             NA                      Österreich        unabhängiger Staat        1994-06-12  1994     6    12 Beitrit…
#> 4 at011978 AT           Austria      FALSE             NA                      Österreich        unabhängiger Staat        1978-11-05  1978    11     5 Bau des…
#> 5 at011938 AT           Austria      FALSE             NA                      Österreich        unabhängiger Staat wird … 1938-04-10  1938     4    10 Anschlu…
#> # ℹ 17 more variables: question_type_de <chr>, result_de <chr>, result_status_de <chr>, adoption_requirements_de <list>, electorate_total <int>,
#> #   votes_total <int>, votes_invalid <int>, votes_valid <int>, votes_yes <int>, votes_no <int>, votes_option_1 <int>, votes_option_2 <int>,
#> #   votes_option_3 <int>, files <list>, remarks <list>, sources <list>, date_last_edited <date>