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.
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.
For additional clarity, the "master records" produce duplicates for cases when the contiguity relationship changed in a given year. This function returns the minimum contiguity relationship observed in that given year. There should be no duplicates in the returned output.
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.
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()
#> Joining with `by = join_by(ccode1, ccode2, year)`
#> # A tibble: 2,139,270 × 4
#> ccode1 ccode2 year conttype
#> <dbl> <dbl> <int> <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,139,260 more rows
create_stateyears() %>% add_contiguity()
#> Joining with `by = join_by(ccode, year)`
#> # A tibble: 17,121 × 5
#> ccode statenme year land sea
#> <dbl> <chr> <int> <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,111 more rows
# }