Learn R Programming

peacesciencer (version 0.4.0)

add_contiguity: Add Correlates of War direct contiguity information to a dyad-year or state-year data frame

Description

add_contiguity() allows you to add Correlates of War contiguity data to a dyad-year or state-year data frame.

Usage

add_contiguity(data)

Arguments

data

a dyad-year data frame (either "directed" or "non-directed") or a state-year data frame

Value

add_contiguity() takes a dyad-year 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, the function returns the lowest contiguity type observed in the dyad-year (if contiguity is observed at all). If the data are state-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 1 to 6. 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). 6 = separated by more than 400 miles of water (i.e. not contiguous).

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.

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

Run this code
# NOT RUN {
# }
# NOT RUN {
# just call `library(tidyverse)` at the top of the your script
library(magrittr)

cow_ddy %>% add_contiguity()

create_stateyears() %>% add_contiguity()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab