andybega / states

Create country-year/month/day panels consistent with the COW or Gleditsch & Ward independent states lists
https://andybeger.com/states/
Other
14 stars 0 forks source link

Code micro states for COW state list #21

Closed andybega closed 3 years ago

andybega commented 4 years ago

gwstates has a micro states coding:

library(states)
data(gwstates)
head(gwstates[, c("country_name", "microstate")])
#>               country_name microstate
#> 1 United States of America      FALSE
#> 2                   Canada      FALSE
#> 3                  Bahamas      FALSE
#> 4                     Cuba      FALSE
#> 5                    Haiti      FALSE
#> 6                    Haiti      FALSE

Created on 2020-10-15 by the reprex package (v0.3.0)

Translate those codings for the COW list as well (they are currently missing)

library(states)
data(cowstates)
str(cowstates)
#> 'data.frame':    243 obs. of  5 variables:
#>  $ cowcode     : num  2 20 31 40 40 41 41 42 42 51 ...
#>  $ cowc        : chr  "USA" "CAN" "BHM" "CUB" ...
#>  $ country_name: chr  "United States of America" "Canada" "Bahamas" "Cuba" ...
#>  $ start       : Date, format: "1816-01-01" "1920-01-10" ...
#>  $ end         : Date, format: "9999-12-31" "9999-12-31" ...
#>  - attr(*, "spec")=List of 3
#>   ..$ cols   :List of 10
#>   .. ..$ stateabb: list()
#>   .. .. ..- attr(*, "class")= chr [1:2] "collector_character" "collector"
#>   .. ..$ ccode   : list()
#>   .. .. ..- attr(*, "class")= chr [1:2] "collector_double" "collector"
#>   .. ..$ statenme: list()
#>   .. .. ..- attr(*, "class")= chr [1:2] "collector_character" "collector"
#>   .. ..$ styear  : list()
#>   .. .. ..- attr(*, "class")= chr [1:2] "collector_double" "collector"
#>   .. ..$ stmonth : list()
#>   .. .. ..- attr(*, "class")= chr [1:2] "collector_double" "collector"
#>   .. ..$ stday   : list()
#>   .. .. ..- attr(*, "class")= chr [1:2] "collector_double" "collector"
#>   .. ..$ endyear : list()
#>   .. .. ..- attr(*, "class")= chr [1:2] "collector_double" "collector"
#>   .. ..$ endmonth: list()
#>   .. .. ..- attr(*, "class")= chr [1:2] "collector_double" "collector"
#>   .. ..$ endday  : list()
#>   .. .. ..- attr(*, "class")= chr [1:2] "collector_double" "collector"
#>   .. ..$ version : list()
#>   .. .. ..- attr(*, "class")= chr [1:2] "collector_double" "collector"
#>   ..$ default: list()
#>   .. ..- attr(*, "class")= chr [1:2] "collector_guess" "collector"
#>   ..$ skip   : num 1
#>   ..- attr(*, "class")= chr "col_spec"

Created on 2020-10-15 by the reprex package (v0.3.0)