Get ISO country code from a country name.

get_cc(country)

Arguments

country

A character vector of country names.

Value

A vector of ISO country codes (NA where not found).

Examples

get_cc("Australia")
#> [1] "AU"
get_cc(c("Australia", "China", "United states"))
#> [1] "AU" "CN" "US"