Skip to contents

create_statedays() allows you to create state-day data from either the Correlates of War (CoW) state system membership data or the Gleditsch-Ward (gw) system membership data. The function leans on internal data provided in the package.

Usage

create_statedays(system = "cow", mry = TRUE)

Arguments

system

a character specifying whether the user wants Correlates of War state-years ("cow") or Gleditsch-Ward ("gw") state-years. Correlates of War is the default.

mry

optional, defaults to TRUE. If TRUE, the function extends the script beyond the most recent system membership updates to include observation to the most recently concluded calendar year. For example, the Gleditsch-Ward data extend to the end of 2020. When mry == TRUE, the function returns more recent years (e.g. 2018, 2019) under the assumption that states alive at the end of 2016 or 2020 are still alive today. Use with some care.

Value

create_statedays() takes state system membership data provided by either Correlates of War or Gleditsch-Ward and returns a simple state-day data frame. The Gleditsch-Ward state days include the indicator communicating whether the state is a microstate.

Details

The function leans on data made available in the isard package.

References

Miller, Steven V. 2019. “Create Country-Year and (Non)-Directed Dyad-Year Data With Just a Few Lines in R” https://svmiller.com/blog/2019/01/create-country-year-dyad-year-from-country-data/

Author

Steven V. Miller

Examples

# \donttest{

# CoW is default, will include years beyond 2016 (most recent CoW update)
create_statedays()
#> # A tibble: 6,345,986 × 3
#>    ccode cw_name                  date      
#>    <dbl> <chr>                    <date>    
#>  1     2 United States of America 1816-01-01
#>  2     2 United States of America 1816-01-02
#>  3     2 United States of America 1816-01-03
#>  4     2 United States of America 1816-01-04
#>  5     2 United States of America 1816-01-05
#>  6     2 United States of America 1816-01-06
#>  7     2 United States of America 1816-01-07
#>  8     2 United States of America 1816-01-08
#>  9     2 United States of America 1816-01-09
#> 10     2 United States of America 1816-01-10
#> # ℹ 6,345,976 more rows

# Gleditsch-Ward, include most recent years
create_statedays(system="gw")
#> # A tibble: 7,497,730 × 4
#>    gwcode gw_name                  microstate date      
#>     <dbl> <chr>                         <dbl> <date>    
#>  1      2 United States of America          0 1816-01-01
#>  2      2 United States of America          0 1816-01-02
#>  3      2 United States of America          0 1816-01-03
#>  4      2 United States of America          0 1816-01-04
#>  5      2 United States of America          0 1816-01-05
#>  6      2 United States of America          0 1816-01-06
#>  7      2 United States of America          0 1816-01-07
#>  8      2 United States of America          0 1816-01-08
#>  9      2 United States of America          0 1816-01-09
#> 10      2 United States of America          0 1816-01-10
#> # ℹ 7,497,720 more rows

# }