Downloads the referendum data from the Referendum Database (RDB). See the codebook
for a detailed description of all variables.
Usage
rfrnds(
is_draft = FALSE,
incl_archive = FALSE,
use_cache = TRUE,
max_cache_age = "1 week",
quiet = FALSE
)
Arguments
- is_draft
TRUE
means to include only referendum entries with draft status,FALSE
to include only normal entries. Set toNULL
in order to include both draft and normal entries.- incl_archive
Whether or not to include an
archive
column containing data from an earlier, obsolete state of the Referendum Database (RDB).- use_cache
Whether or not to return cached results if possible. If
FALSE
, results are always newly fetched regardless ofmax_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 ifuse_cache = TRUE
.- quiet
Whether or not to suppress printing status output from internal processing.
Value
A tibble.
See also
Other referendum data functions:
add_rfrnds()
,
assert_vars()
,
count_rfrnds()
,
delete_rfrnds()
,
download_file_attachment()
,
edit_rfrnds()
,
rfrnd()
,
rfrnd_exists()
,
rfrnds_old()
,
search_rfrnds()
,
validate_rfrnds()
Examples
# get all referendums (excl. drafts)
rdb::rfrnds()
#> # A tibble: 17,866 × 69
#> id id_official id_sudd country_code country_name subnational_entity_n…¹ municipality level date is_former_country title_en title_de title_fr
#> <chr> <chr> <chr> <fct> <fct> <chr> <chr> <ord> <date> <lgl> <chr> <chr> <chr>
#> 1 6694f97dc3cd… NA NA CH Switzerland Ticino NA subn… 2024-06-09 NA Tax Ref… NA NA
#> 2 66856a7bc3cd… NA si0420… SI Slovenia NA NA nati… 2024-06-09 NA Referen… NA NA
#> 3 66856972c3cd… NA si0320… SI Slovenia NA NA nati… 2024-06-09 NA Should … NA NA
#> 4 66856835c3cd… NA si0220… SI Slovenia NA NA nati… 2024-06-09 NA Referen… NA NA
#> 5 66856659c3cd… NA si0120… SI Slovenia NA NA nati… 2024-06-09 NA Referen… NA NA
#> 6 6659b208c3cd… NA NA CH Switzerland Schwyz NA subn… 2024-06-09 NA Partial… Teilrev… NA
#> 7 6659b140c3cd… NA NA CH Switzerland Schaffhausen NA subn… 2024-06-09 NA Citizen… Volksin… NA
#> 8 6659af29c3cd… NA NA CH Switzerland Geneva NA subn… 2024-06-09 NA Amendme… NA Loi mod…
#> 9 6659ae82c3cd… NA NA CH Switzerland Geneva NA subn… 2024-06-09 NA To allo… NA Pour pe…
#> 10 6659ad59c3cd… NA NA CH Switzerland Geneva NA subn… 2024-06-09 NA Citizen… NA Initiat…
#> # ℹ 17,856 more rows
#> # ℹ abbreviated name: ¹subnational_entity_name
#> # ℹ 56 more variables: question <chr>, question_en <chr>, committee_name <chr>, result <fct>, subterritories_yes <dbl>, subterritories_no <dbl>,
#> # electorate_total <int>, electorate_abroad <int>, votes_yes <int>, votes_no <int>, votes_empty <int>, votes_invalid <int>, votes_per_subterritory <list>,
#> # lower_house_yes <int>, lower_house_no <int>, lower_house_abstentions <int>, upper_house_yes <int>, upper_house_no <int>, upper_house_abstentions <int>,
#> # position_government <fct>, topics_tier_1 <list>, topics_tier_2 <list>, topics_tier_3 <list>, remarks <chr>, files <list>, url_sudd <chr>,
#> # url_swissvotes <chr>, sources <chr>, is_draft <lgl>, date_time_created <dttm>, date_time_last_edited <dttm>, type <fct>, inst_legal_basis_type <ord>, …