bdc_country_standardized {bdc}R Documentation

Standardizes country names and gets country code

Description

This function standardizes country names and adds a new column to the database containing two-letter country codes (ISO 3166-1 alpha-2).

Usage

bdc_country_standardized(data, country = "country")

Arguments

data

data.frame. Containing country names

country

character string. The column name with the country assignment of each record. Default = "country".

Details

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.

Value

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).

See Also

Other prefilter: bdc_basisOfRecords_notStandard(), bdc_coordinates_country_inconsistent(), bdc_coordinates_empty(), bdc_coordinates_from_locality(), bdc_coordinates_outOfRange(), bdc_coordinates_transposed(), bdc_scientificName_empty()

Examples

## Not run: 
country <- c("BOLIVIA", "bolivia", "Brasil", "Brazil", "BREZIL")
x <- data.frame(country)

bdc_country_standardized(
  data = x,
  country = "country"
)

## End(Not run)


[Package bdc version 1.1.4 Index]