Augments data
with an additional column is_former_country
indicating whether or not the column country_code
holds an ISO 3166-3 alpha-4 code referring to a historical country which ceased to exist. is_former_country
being FALSE
means
country_code
holds an ISO 3166-1 alpha-2 code instead.
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_continual()
,
add_country_code_long()
,
add_country_name()
,
add_country_name_long()
,
add_period()
,
add_turnout()
,
add_urls()
,
add_world_regions()
Examples
rdb::rfrnds() |>
rdb:::add_former_country_flag() |>
dplyr::select(id,
starts_with("country_"),
is_former_country)
#> # A tibble: 17,889 × 4
#> id country_code country_name is_former_country
#> <chr> <fct> <fct> <lgl>
#> 1 670cd145c3cd67046058015c CH Switzerland FALSE
#> 2 66fff490c3cd670460580111 LI Liechtenstein FALSE
#> 3 66ffdfe3c3cd6704605800fc CH Switzerland FALSE
#> 4 66f686cfc3cd6704605800a0 CH Switzerland FALSE
#> 5 66f68317c3cd67046058009c CH Switzerland FALSE
#> 6 66d6da9cc3cd670460580053 CH Switzerland FALSE
#> 7 66cde603c3cd67046057fff5 CH Switzerland FALSE
#> 8 66c46f86c3cd67046057ff53 CH Switzerland FALSE
#> 9 66c46cf6c3cd67046057ff4f CH Switzerland FALSE
#> 10 66c46c3ac3cd67046057ff4b CH Switzerland FALSE
#> # ℹ 17,879 more rows