standardizeCountry: Standardize country name

View source: R/standardizeCountry.R

standardizeCountryR Documentation

Standardize country name

Description

Standardizes country names to the list of countries used internally by this package.

Usage

standardizeCountry(country, fuzzyDist = 1, nthreads = 1, progressBar = TRUE)

Arguments

country

character vector of country names or ISO codes

fuzzyDist

for fuzzy searching, the maximum string distance allowed for a match; if 0, fuzzy searching is disabled.

nthreads

number of threads to use for parallelization of the function. The R package parallel must be loaded for nthreads > 1.

progressBar

if FALSE, progress bar will be suppressed.

Details

This package interacts with data from the Global Invasive Species Database (GISD), the Reptile Database, as well as global maps that were used to generate the internal dataset used by closestCountry. Efforts have been made to make country names consistent across these separate datasets. This function can be used to convert the user's Country field to the same standardized set.

Fuzzy matching uses the function adist.

Parallelization with nthreads becomes more time-efficient only if the input vector is of multiple thousands of country names.

Value

Character vector of the standardized country names. If no match found, "" is returned.

Author(s)

Pascal Title

Examples


standardizeCountry(c("Russian Federation", "USA", "Plurinational State of Bolivia", "Brezil"))


rangeBuilder documentation built on March 7, 2023, 5:30 p.m.