Augments data
with an additional column country_code_continual
holding the current or future ISO 3166-1 alpha-2 code of the country where the referendum took place. If the country still exists,
country_code_continual
is identical to country_code
, otherwise it is the country_code
of the successor country. If the country was succeeded by
multiple countries, the code of the largest one in terms of population is taken.
Arguments
- data
RDB referendum data as returned by
rfrnds()
. A data frame that at minimum contains the columncountry_code
(with ISO 3166-1 alpha-2 or ISO 3166-3 alpha-4 codes).
Value
A tibble.
See also
Other referendum data augmentation functions:
add_country_code_long()
,
add_country_name_long()
,
add_country_name()
,
add_former_country_flag()
,
add_period()
,
add_turnout()
,
add_urls()
,
add_world_regions()
Examples
rdb::rfrnds(quiet = TRUE) |>
rdb::add_country_code_continual() |>
dplyr::select(id,
starts_with("country_"))
#> # A tibble: 17,766 × 4
#> id country_code country_name country_code_continual
#> <chr> <fct> <fct> <fct>
#> 1 65096e84481d20233932cc70 PL Poland PL
#> 2 65096dc1481d20233932cc6e PL Poland PL
#> 3 65096535481d20233932cc66 PL Poland PL
#> 4 6509625d481d20233932cc63 PL Poland PL
#> 5 650034e4481d20233932cc39 AU Australia AU
#> 6 64e46f7a481d20233932cc0b EC Ecuador EC
#> 7 64e46c8f481d20233932cc09 FM Micronesia FM
#> 8 64c8b3ca0b8bae0c78c7ec8a FM Micronesia FM
#> 9 64c8b19c0b8bae0c78c7ec86 FM Micronesia FM
#> 10 64c8a28d0b8bae0c78c7ec82 FM Micronesia FM
#> # ℹ 17,756 more rows