add_gwcode_to_cow: Add Gleditsch-Ward state system codes to your data with...

View source: R/add_gwcode_to_cow.R

add_gwcode_to_cowR Documentation

Add Gleditsch-Ward state system codes to your data with Correlates of War state codes.


add_gwcode_to_cow() allows you to match, as well as one can, Gleditsch-Ward system membership data with Correlates of War state system membership data.





a data frame with appropriate peacesciencer attributes


The data-raw directory on the project's Github contains more information about the underlying data that assists in merging in these codes.

The user will invariably need to be careful and ask why they want these data included. The issue here is that both have a different composition and the merging process will not (and cannot) be perfect. We can note that a case like Serbia/Yugoslavia is not too difficult to handle (since "Serbia" never overlaps with "Yugoslavia" in the Gleditsch-Ward data and Correlates of War understands Serbia as the predecessor state, dominant state, and successor state to Yugoslavia). However, there is greater weirdness with a case like Yemen/Yemen Arab Republic. The script will not create state-year or dyad-year duplicates for the Correlates of War codes. The size of the original data remain unchanged. However, there will be some year duplicates for various Gleditsch-Ward codes (e.g. Yemen, again). Use with care. You can also use the countrycode package. Whether you use this function or the countrycode package, do not do this kind of merging without assessing the output.


add_gwcode_to_cow() takes a (dyad-year, leader-year, leader-dyad-year, state-year) data frame that already has Correlates of War state system codes and adds their corollary Gleditsch-Ward codes.


Steven V. Miller


# just call `library(tidyverse)` at the top of the your script

cow_ddy %>% add_gwcode_to_cow()

create_stateyears() %>% add_gwcode_to_cow()

peacesciencer documentation built on March 31, 2023, 8:37 p.m.