add_cow_trade() allows you to add Correlates of War alliance data to a dyad-year data frame

add_cow_trade(data)

Arguments

data

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

Value

add_cow_trade() takes a dyad-year data frame or state-year data frame and adds information about the volume of trade in that given dyad-year or state-year. For the state-year data, these are minimally the sum of all imports and the sum of all exports. For dyad-year data, this function returns the value of imports in current million USD in the first country from the second country (and vice-versa) along with their "smooth" equivalents.

Details

For the dyad-year data, there must be some kind of information loss in order to work within the limited space available to this package. This package loads a truncated version of the data in which the trade values are rounded to integers in order to greatly reduce the disk space for this package. I do not think this to be terribly problematic, though I admit I do not like it. If this is a problem for your research question, you may want to consider not using this function for dyad-year data.

References

Barbieri, Katherine, Omar M. G. Keshk, and Brian Pollins. 2009. "TRADING DATA: Evaluating our Assumptions and Coding Rules." Conflict Management and Peace Science. 26(5): 471-491.

Author

Steven V. Miller

Examples

# \donttest{ # just call `library(tidyverse)` at the top of the your script library(magrittr) cow_ddy %>% add_cow_trade()
#> Joining, by = c("ccode1", "ccode2", "year")
#> # A tibble: 2,063,670 x 7 #> ccode1 ccode2 year flow1 flow2 smoothflow1 smoothflow2 #> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 2 20 1920 612 735 612 735 #> 2 2 20 1921 335 443 335 443 #> 3 2 20 1922 364 503 364 503 #> 4 2 20 1923 416 598 416 598 #> 5 2 20 1924 399 496 399 496 #> 6 2 20 1925 474 608 474 608 #> 7 2 20 1926 975 610 474 610 #> 8 2 20 1927 475 718 475 718 #> 9 2 20 1928 489 866 489 866 #> 10 2 20 1929 503 846 503 846 #> # … with 2,063,660 more rows
# }