library(tidyverse)
library(vdemdata)
vdem2022 <- vdem |>
filter(year == 2022) |>
select(
country = country_name,
regime = v2x_regime,
region = e_regionpol_6C
) |>
mutate(
region = case_match(region, # replace the values in region with country names
1 ~ "Eastern Europe",
2 ~ "Latin America",
3 ~ "Middle East",
4 ~ "Africa",
5 ~ "The West",
6 ~ "Asia")
) |>
mutate(regime = case_match(regime,
0 ~ "Closed Autocracy",
1 ~ "Electoral Autocracy",
2 ~ "Electoral Democracy",
3 ~ "Liberal Democracy")
)