igo_members: Extract members of an IGO

View source: R/igo_members.R

igo_membersR Documentation

Extract members of an IGO

Description

Extract all the countries belonging to an IGO on a specific date.

Usage

igo_members(ioname, year = NULL, status = "Full Membership")

Arguments

ioname

Any valid ioname of an IGO as specified on igo_year_format3. It could be also a vector of IGOs.

year

Year to be assessed, an integer or an array of year. If NULL the latest year available of the IGO would be extracted.

status

Character or vector with the membership status to be extracted. See Details on state_year_format3.

Value

A data.frame.

See Also

igo_year_format3, igo_search(), state_year_format3.

Examples

library(dplyr)
igo_members("EU", year = 1993) %>% as_tibble()
igo_members("EU") %>% as_tibble()
igo_members("NAFTA", year = c(1995:1998)) %>% as_tibble()

# Extract different status
igo_members("ACCT", status = c("Associate Membership", "Observer")) %>%
  as_tibble()

# States no members of the UN
igo_members("UN", status = "No Membership") %>%
  as_tibble()

# Vectorized
igo_members(c("NAFTA", "EU"), year = 1993) %>%
  as_tibble() %>%
  arrange(state)

# Use countrycodes package to get additional codes
if (requireNamespace("countrycode", quietly = TRUE)) {
  library(countrycode)
  EU <- igo_members("EU")
  EU$iso3c <- countrycode(EU$ccode, origin = "cown", destination = "iso3c")

  EU$continent <- countrycode(EU$ccode,
    origin = "cown",
    destination = "continent"
  )

  tibble(EU)
}

dieghernan/igoR documentation built on April 24, 2024, 2:15 a.m.