igo_state_membership: Extract Memberships of a State

View source: R/igo_state_membership.R

igo_state_membershipR Documentation

Extract Memberships of a State

Description

Extract all the memberships of a state on a specific date.

Usage

igo_state_membership(state, year = NULL, status = "Full Membership")

Arguments

state

Any valid name or code of a state as specified on states2016. It could be also a vector of states

year

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

status

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

Value

A dataframe.

See Also

igo_year_format3, igo_search_states(), states2016.

Examples

# Memberships on two different dates
igo_state_membership("Spain", year = 1850)
igo_state_membership("Spain", year = 1870)
igo_state_membership("Spain", year = 1880:1882)

# Last year
igo_state_membership("ZAN")[, 1:7]

# Use codes to get countries
igo_state_membership("2", year = 1865)

# Extract different status

igo_state_membership("kosovo",
  status = c(
    "Associate Membership",
    "Observer",
    "Full Membership"
  )
)

# Vectorized
igo_state_membership(c("usa", "spain"),
  year = 1870:1871
)

# Use countrycodes package to get additional codes
if (requireNamespace("countrycode", quietly = TRUE)) {
  library(countrycode)
  IT <- igo_state_membership("Italy", year = 1880)
  IT$iso3c <- countrycode(IT$ccode,
    origin = "cown",
    destination = "iso3c"
  )
  head(IT)
}

igoR documentation built on April 14, 2023, 5:10 p.m.