Add Correlates of War direct contiguity information to a data frame
Source:R/add_contiguity.R
add_contiguity.Rd
add_contiguity()
allows you to add Correlates of War
contiguity data to a dyad-year, leader-year, or leader-dyad-year, or
state-year data frame.
Arguments
- data
a data frame with appropriate peacesciencer attributes
- slice
takes one of 'first' or 'last', determines behavior for when there is a change in a contiguity relationship in a given dyad in a given year. If 'first', the earlier contiguity relationship is recorded. If 'last', the latest contiguity relationship is recorded.
- mry
logical, defaults to
FALSE
. IfTRUE
, the data carry forward the identity of the major powers to the most recently concluded calendar year. IfFALSE
, the panel honors the right bound of the data's temporal domain and creates NAs for observations past it.
Value
add_contiguity()
takes a data frame and adds information
about the contiguity relationship based on the "master records" for the
Correlates of War direct contiguity data (v. 3.2). If the data are dyad-year
(or leader dyad-year), the function returns the lowest contiguity type
observed in the dyad-year (if contiguity is observed at all). If the data
are state-year (or leader-year), the data return the total number of
land and sea borders calculated from these master records.
Details
The contiguity codes in the dyad-year data range from 0 to 5. 1 = direct land contiguity. 2 = separated by 12 miles of water or fewer (a la Stannis Baratheon). 3 = separated by 24 miles of water or fewer (but more than 12 miles). 4 = separated by 150 miles of water or fewer (but more than 24 miles). 5 = separated by 400 miles of water or fewer (but more than 150 miles).
Importantly, 0 are the dyads that are not contiguous at all in the CoW contiguity data. This is a conscious decision on my part as I do not think of the CoW's contiguity data as exactly ordinal. Cross-reference CoW's contiguity data with the minimum distance data in this exact package to see how some dyads that CoW codes as not contiguous are in fact very close to each other, sometimes even land-contiguous. For example, Zimbabwe and Namibia are separated by only about a few hundred feet of water at that peculiar intersection of the Zambezi River where the borders of Zambia, Botswana, Namibia, and Zimbabwe meet. There is no contiguity record for this in the CoW data. There are other cases where contiguity records are situationally missing (e.g. India-Bangladesh, and Bangladesh-Myanmar in 1971) or other cases where states are much closer than CoW's contiguity data imply (e.g. Pakistan and the Soviet Union were separated by under 30 kilometers of Afghani territory). The researcher is free to recode these 0s to be, say, 6s, but this is why peacesciencer does not do this.
The mry
argument works on an informal assumption that what CoW understands
as contiguity relationships are unchanged since the last data update on record.
This assumption is not problematic for composition/membership data, but it is
questionable in light of current events past the temporal reach of the project.
It is why the default is FALSE
for this particular argument. Please use
with caution.
Be mindful that the data are fundamentally state-year and that extensions to leader-level data should be understood as approximations for leaders in a given state-year. Future updates aspire to fine-tune this behavior, but be mindful of its current limitations.
There are contiguity relationship observed in the data that precede state system entry in some cases (see: Palau-Federated States of Micronesia). The functions I employ still fundamentally respect the state system data and will not create observations in instances like these.
References
Stinnett, Douglas M., Jaroslav Tir, Philip Schafer, Paul F. Diehl, and Charles Gochman (2002). "The Correlates of War Project Direct Contiguity Data, Version 3." Conflict Management and Peace Science 19 (2):58-66.
Examples
# \donttest{
# just call `library(tidyverse)` at the top of the your script
library(magrittr)
cow_ddy %>% add_contiguity()
#> # A tibble: 2,214,930 × 4
#> ccode1 ccode2 year conttype
#> <dbl> <dbl> <dbl> <dbl>
#> 1 2 20 1920 1
#> 2 2 20 1921 1
#> 3 2 20 1922 1
#> 4 2 20 1923 1
#> 5 2 20 1924 1
#> 6 2 20 1925 1
#> 7 2 20 1926 1
#> 8 2 20 1927 1
#> 9 2 20 1928 1
#> 10 2 20 1929 1
#> # ℹ 2,214,920 more rows
create_stateyears() %>% add_contiguity()
#> Joining with `by = join_by(ccode, year)`
#> # A tibble: 17,511 × 5
#> ccode statenme year land sea
#> <dbl> <chr> <dbl> <dbl> <dbl>
#> 1 2 United States of America 1816 0 0
#> 2 2 United States of America 1817 0 0
#> 3 2 United States of America 1818 0 0
#> 4 2 United States of America 1819 0 0
#> 5 2 United States of America 1820 0 0
#> 6 2 United States of America 1821 0 0
#> 7 2 United States of America 1822 0 0
#> 8 2 United States of America 1823 0 0
#> 9 2 United States of America 1824 0 0
#> 10 2 United States of America 1825 0 0
#> # ℹ 17,501 more rows
# }