These functions convert the numerical code of igo_year_format3 and state_year_format3 into factors.
igo_recode_igoyear()
is intended to work with values on igo_year_format3.igo_recode_stateyear()
is intended to work with values on state_year_format3.igo_recode_dyadic()
is intended to work with values onigo_dyadic()
.
Value
The recoded values as factors.
See also
Other datasets:
igo_year_format3
,
state_year_format3
,
states2016
Examples
data("igo_year_format3")
# Recode memberships for some countries
library(dplyr)
samp <- igo_year_format3 %>%
select(ioname:year, spain, france) %>%
filter(year > 2000) %>%
as_tibble()
glimpse(samp)
#> Rows: 4,661
#> Columns: 5
#> $ ioname <chr> "ACPEU", "ACPEU", "ACPEU", "ACPEU", "ACPEU", "ACPEU", "ACPEU",…
#> $ orgname <chr> "ACP/EU Joint Assembly", "ACP/EU Joint Assembly", "ACP/EU Join…
#> $ year <dbl> 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 20…
#> $ spain <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,…
#> $ france <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
# Recode
samp %>%
mutate(
spain = igo_recode_igoyear(spain),
france = igo_recode_igoyear(france)
) %>%
glimpse()
#> Rows: 4,661
#> Columns: 5
#> $ ioname <chr> "ACPEU", "ACPEU", "ACPEU", "ACPEU", "ACPEU", "ACPEU", "ACPEU",…
#> $ orgname <chr> "ACP/EU Joint Assembly", "ACP/EU Joint Assembly", "ACP/EU Join…
#> $ year <dbl> 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 20…
#> $ spain <fct> Full Membership, Full Membership, Full Membership, Full Member…
#> $ france <fct> Full Membership, Full Membership, Full Membership, Full Member…