Learn R Programming

peacesciencer (version 1.2.0)

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

Description

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.

Usage

add_gwcode_to_cow(data)

Value

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.

Arguments

data

a data frame with appropriate peacesciencer attributes

Author

Steven V. Miller

Details

As of version 1.2, this function leans on the information made available in the isard package. This is a spin-off package I maintain for data that require periodic updates for the functionality in this package. As of writing, peacesciencer only requires that you have the isard package installed. It does not require you to have any particular version of the package installed. Thus, what exactly this function returns may depend on the particular version of isard you have installed. This will assuredly concern the right-bound of the temporal domain of data you get.

You can read more about the data in the documentation for isard.

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.

Examples

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

cow_ddy %>% add_gwcode_to_cow()

create_stateyears() %>% add_gwcode_to_cow()


Run the code above in your browser using DataLab