R/data.R

#' Intergovernmental organizations by year
#'
#' @name igo_year_format3
#'
#' @docType data
#' @encoding UTF-8
#' @inherit igo_dyadic references
#'
#' @description
#' Data on IGOs from 1815 to 2014 at the IGO-year level. Contains one record
#' per IGO-year, with years listed at five-year intervals through 1965 and
#' annually thereafter.
#'
#' @source
#' [Intergovernmental Organizations
#' (v3)](https://correlatesofwar.org/data-sets/IGOs/), The Correlates of War
#' Project (IGO Data Stata Files).
#'
#' @details
#' Possible values for the status of a state in the IGO are:
#'
#' ```{r, echo=FALSE}
#'
#' tb <- data.frame(
#'   "Category" = c(
#'     "No Membership", "Full Membership", "Associate Membership",
#'     "Observer", "Missing data", "State Not System Member"
#'   ),
#'   "Numerical" = c(0, 1, 2, 3, -9, -1)
#' )
#'
#' knitr::kable(tb, col.names = c("**Category**", "**Numerical Value**"))
#'
#' ```
#'
#' See the [igo_recode_igoyear()] section for an easy way to recode the
#' numerical values into [factors][base::factor].
#'
#' @format
#' [`data.frame`][data.frame()] with
#' `r prettyNum(nrow(igoR::igo_year_format3), big.mark=",")` rows. Relevant
#' fields:
#'
#' - **ioname**: Short abbreviation of the IGO name.
#' - **orgname**: Full IGO name.
#' - **year**: Calendar year.
#' - **afghanistan...zimbabwe**: Status of that state in the IGO. See
#'   **Details**.
#' - **sdate**: Start year for the IGO.
#' - **deaddate**: End year for the IGO.
#' - **longorgname**: Longer version of the IGO name, including previous
#'   names.
#' - **ionum**: IGO ID number in v2.1 and v3.0 of the data.
#' - **version**: COW version number.
#'
#' See [**Codebook Version 3 IGO
#' Data**](https://correlatesofwar.org/data-sets/IGOs/) for full reference.
#'
#' @family datasets
#'
#' @note Raw data used internally by \CRANpkg{igoR}.
#'
#' @examples
#' data("state_year_format3")
#'
#' # Show a glimpse.
#' library(dplyr)
#'
#' state_year_format3 %>%
#'   select(ccode:afgec) %>%
#'   filter(year > 1990) %>%
#'   glimpse()
#'
#' # Recode numerical values to factors with a sample.
#' sample_state_year <- state_year_format3 %>%
#'   as_tibble() %>%
#'   select(ccode:afgec) %>%
#'   filter(year == 1990)
#'
#' sample_state_year %>% glimpse()
#'
#' # Recode.
#' sample_state_year_recoded <- sample_state_year %>%
#'   mutate(across(-c(ccode:state), igo_recode_stateyear))
#'
#' sample_state_year_recoded %>% glimpse()
NULL

#' Country membership in IGOs by year
#'
#' @name state_year_format3
#'
#' @docType data
#' @encoding UTF-8
#' @inherit igo_year_format3 source references note
#'
#' @description
#' Data on IGOs from 1815 to 2014 at the country-year level. Contains one
#' record per country-year, with years listed at five-year intervals through
#' 1965 and annually thereafter.
#'
#' @details
#' Possible values for the status of a state in the IGO are:
#'
#' ```{r, echo=FALSE}
#'
#' tb <- data.frame(
#'   "Category" = c(
#'     "No Membership", "Full Membership", "Associate Membership",
#'     "Observer", "Missing data", "IGO Not In Existence"
#'   ),
#'   "Numerical" = c(0, 1, 2, 3, -9, -1)
#' )
#'
#' knitr::kable(tb, col.names = c("**Category**", "**Numerical Value**"))
#'
#' ```
#' See the [igo_recode_stateyear()] section for an easy way to recode the
#' numerical values into [factors][base::factor].
#'
#' @format [`data.frame`][data.frame()] with
#' `r prettyNum(nrow(igoR::state_year_format3), big.mark=",")` rows. Relevant
#' fields:
#'
#' - **ccode**: COW country number, see [states2016].
#' - **year**: Calendar year.
#' - **state**: Abbreviated state name, identical to variable names in
#'   [igo_year_format3].
#' - **aaaid...wassen**: IGO variables containing information on state
#'   membership status. See **Details**.
#'
#' See [**Codebook Version 3 IGO
#' Data**](https://correlatesofwar.org/data-sets/IGOs/).
#'
#' @seealso
#' [countrycode::countrycode()] to convert between different country code
#' schemes.
#'
#' @family datasets
#'
#' @examples
#' data("state_year_format3")
#' dplyr::tibble(state_year_format3)
#'
NULL

#' State system membership (v2016)
#'
#' @name states2016
#'
#' @docType data
#' @encoding UTF-8
#'
#' @description
#' The list of states with COW abbreviations and ID numbers, plus the field
#' `state` from [state_year_format3].
#'
#' @source
#' [State System Membership
#' (v2016)](https://correlatesofwar.org/data-sets/state-system-membership/),
#' The Correlates of War Project.
#'
#' @format [`data.frame`][data.frame()] with
#' `r prettyNum(nrow(igoR::states2016), big.mark=",")` rows. Relevant fields:
#'
#' - **ccode**: COW country number.
#' - **stateabb**: COW state abbreviation (3 characters).
#' - **statenme**: COW state name.
#' - **styear...endday**: Fields that identify the beginning and end of each
#'   tenure.
#' - **version**: Data file version number.
#' - **state**: Abbreviated state name as it appears in [state_year_format3].
#'
#' @family datasets
#'
#' @details
#' This data set contains the list of states in the international system as
#' updated and distributed by the Correlates of War Project.
#'
#' These data sets identify states, their standard Correlates of War "country
#' code" or state number (used throughout the Correlates of War project data
#' sets), state abbreviations, and dates of membership as states and major
#' powers in the international system.
#'
#' The Correlates of War Project includes a state in the international system
#' from 1816 to 2016 according to the following criteria:
#'
#' - **Before 1920**, the entity must have had a population greater than
#'   500,000 and have had diplomatic missions at or above the rank of charge
#'   d'affaires with Britain and France.
#'
#' - **After 1920**, the entity must be a member of the League of Nations or the
#'   United Nations, or have a population greater than 500,000 and receive
#'   diplomatic missions from two major powers.
#'
#' @note
#' The `state` variable was added to the original data to help comparisons
#' across data sets in this package.
#'
#' @references
#' Correlates of War Project. 2017 "State System Membership List, v2016."
#' Online, <https://correlatesofwar.org/>.
#'
#' @examples
#' # Example code.
#' data("states2016")
#' dplyr::glimpse(states2016)
NULL

Try the igoR package in your browser

Any scripts or data that you put into this service are public.

igoR documentation built on May 23, 2026, 5:08 p.m.