Skip to contents

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

Usage

add_ccode_to_gw(data)

Arguments

data

a data frame with appropriate peacesciencer attributes

Value

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

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 Gran Colombia is not too difficult to handle (i.e. CoW does not have this entity and none of the splinter states conflict with CoW's coding). However, there is greater weirdness with a case like the unification of West Germany and East Germany. Herein, Correlates of War treats the unification as the reappearance of the original Germany whereas Gleditsch-Ward treat the unification as an incorporation of East Germany into West Germany. The script will not create state-year or dyad-year duplicates for the Gleditsch-Ward codes. The size of the original data remain unchanged. However, there will be some year duplicates for various Correlates of War codes (prominently Serbia and Yugoslavia in 2006). 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.

Author

Steven V. Miller

Examples

# \donttest{
# just call `library(tidyverse)` at the top of the your script
library(magrittr)

create_dyadyears(system = "gw") %>% add_ccode_to_gw()
#> Joining with `by = join_by(gwcode1, gwcode2, year, microstate1, microstate2)`
#> # A tibble: 2,599,466 × 7
#>    gwcode1 gwcode2  year microstate1 microstate2 ccode1 ccode2
#>      <dbl>   <dbl> <dbl>       <dbl>       <dbl>  <dbl>  <dbl>
#>  1       2      20  1867           0           0      2     NA
#>  2       2      20  1868           0           0      2     NA
#>  3       2      20  1869           0           0      2     NA
#>  4       2      20  1870           0           0      2     NA
#>  5       2      20  1871           0           0      2     NA
#>  6       2      20  1872           0           0      2     NA
#>  7       2      20  1873           0           0      2     NA
#>  8       2      20  1874           0           0      2     NA
#>  9       2      20  1875           0           0      2     NA
#> 10       2      20  1876           0           0      2     NA
#> # ℹ 2,599,456 more rows

create_stateyears(system = 'gw') %>% add_ccode_to_gw()
#> # A tibble: 20,652 × 5
#>    gwcode gw_name                  microstate  year ccode
#>     <dbl> <chr>                         <dbl> <dbl> <dbl>
#>  1      2 United States of America          0  1816     2
#>  2      2 United States of America          0  1817     2
#>  3      2 United States of America          0  1818     2
#>  4      2 United States of America          0  1819     2
#>  5      2 United States of America          0  1820     2
#>  6      2 United States of America          0  1821     2
#>  7      2 United States of America          0  1822     2
#>  8      2 United States of America          0  1823     2
#>  9      2 United States of America          0  1824     2
#> 10      2 United States of America          0  1825     2
#> # ℹ 20,642 more rows
# }