R/bdc_country_standardized.R
bdc_country_standardized.Rd
This function standardizes country names and adds a new column to the database containing two-letter country codes (ISO 3166-1 alpha-2).
bdc_country_standardized(data, country = "country")
A data.frame containing two columns: country_suggested (standardized country names) and country_code (two-letter country codes; more details in World Countries, International Organization for Standardization).
Country names are standardized using an exact matching against a list of country names in several languages from International Organization for Standardization. If any unmatched names remain, a fuzzy matching algorithm is used to find potential candidates for each misspelled countries names.
if (FALSE) { # \dontrun{
country <- c("BOLIVIA", "bolivia", "Brasil", "Brazil", "BREZIL")
x <- data.frame(country)
bdc_country_standardized(
data = x,
country = "country"
)
} # }