# Load countrycode
library(countrycode)
# Create new iso3c variable
democracy <- democracy |>
mutate(iso3c = countrycode(sourcevar = vdem_ctry_id, # what we are converting
origin = "vdem", # we are converting from vdem
destination = "wb")) |> # and converting to the WB iso3c code
relocate(iso3c, .after = vdem_ctry_id) # move iso3c
# View the data
glimpse(democracy)







