Skip to contents

add_archigos() allows you to add some information about leaders to dyad-year or state-year data. The function leans on an abbreviated version of the data, which also comes in this package.

Usage

add_archigos(data)

Arguments

data

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

Value

add_archigos() takes a dyad-year or state-year data frame and adds a few summary variables based off the leader-level data. These include whether there was a leader transition in the state-year (or first/second state in the dyad-year), whether there was an "irregular" leader transition, the number of leaders in the state-year, the unique leader ID for Jan. 1 of the year, and the unique leader ID for Dec. 31 of the year.

Details

The function leans on attributes of the data that are provided by the create_dyadyear() or create_stateyear() function. Make sure that function (or data created by that function) appear at the top of the proverbial pipe.

References

Goemans, Henk E., Kristian Skrede Gleditsch, and Giacomo Chiozza. 2009. "Introducing Archigos: A Dataset of Political Leaders" Journal of Peace Research 46(2): 269--83.

Author

Steven V. Miller

Examples

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

cow_ddy %>% add_archigos()
#> Joining with `by = join_by(gwcode, year)`
#> # A tibble: 2,139,270 × 13
#>    ccode1 ccode2  year leadertransition1 irregular1 n_leaders1 jan1obsid1
#>     <dbl>  <dbl> <dbl>             <dbl>      <dbl>      <int> <chr>     
#>  1      2     20  1920                 0          0          1 USA-1913  
#>  2      2     20  1921                 1          0          2 USA-1913  
#>  3      2     20  1922                 0          0          1 USA-1921  
#>  4      2     20  1923                 1          0          2 USA-1921  
#>  5      2     20  1924                 0          0          1 USA-1923  
#>  6      2     20  1925                 0          0          1 USA-1923  
#>  7      2     20  1926                 0          0          1 USA-1923  
#>  8      2     20  1927                 0          0          1 USA-1923  
#>  9      2     20  1928                 0          0          1 USA-1923  
#> 10      2     20  1929                 1          0          2 USA-1923  
#> # ℹ 2,139,260 more rows
#> # ℹ 6 more variables: dec31obsid1 <chr>, leadertransition2 <dbl>,
#> #   irregular2 <dbl>, n_leaders2 <int>, jan1obsid2 <chr>, dec31obsid2 <chr>

create_stateyears() %>% add_archigos()
#> Joining with `by = join_by(gwcode, year)`
#> # A tibble: 17,121 × 8
#>    ccode statenme            year leadertransition irregular n_leaders jan1obsid
#>    <dbl> <chr>              <dbl>            <dbl>     <dbl>     <int> <chr>    
#>  1     2 United States of …  1816               NA        NA        NA NA       
#>  2     2 United States of …  1817               NA        NA        NA NA       
#>  3     2 United States of …  1818               NA        NA        NA NA       
#>  4     2 United States of …  1819               NA        NA        NA NA       
#>  5     2 United States of …  1820               NA        NA        NA NA       
#>  6     2 United States of …  1821               NA        NA        NA NA       
#>  7     2 United States of …  1822               NA        NA        NA NA       
#>  8     2 United States of …  1823               NA        NA        NA NA       
#>  9     2 United States of …  1824               NA        NA        NA NA       
#> 10     2 United States of …  1825               NA        NA        NA NA       
#> # ℹ 17,111 more rows
#> # ℹ 1 more variable: dec31obsid <chr>
# }