add_country_code_long: Add long country code to referendum data

add_country_code_longR Documentation

Add long country code to referendum data

Description

Augments data with an additional column holding the current or former three-letter ISO 3166-1 alpha-3 code of the country in which the referendum took place (see ISO 3166-3 for former country codes).

Usage

add_country_code_long(data)

Arguments

data

RDB referendum data as returned by rfrnds(). A data frame that at minimum contains the column country_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_name(), add_country_name_long(), add_former_country_flag(), add_period(), add_turnout(), add_urls(), add_world_regions()

Examples

rdb::rfrnds(quiet = TRUE) |>
  rdb:::add_country_code_long() |>
  dplyr::select(id,
                starts_with("country_"))

zdaarau/c2d documentation built on Dec. 18, 2024, 1:24 p.m.