data("state_year_format3")
# Show a glimpse
library(dplyr)
state_year_format3 %>%
select(ccode:afgec) %>%
filter(year > 1990) %>%
glimpse()
# Recode numerical to factors: with a sample
sample_state_year <- state_year_format3 %>%
as_tibble() %>%
select(ccode:afgec) %>%
filter(year == 1990)
sample_state_year %>% glimpse()
# Recode
sample_state_year_recoded <- sample_state_year %>%
mutate(across(-c(ccode:state), igo_recode_stateyear))
sample_state_year_recoded %>% glimpse()
Run the code above in your browser using DataLab