encode_country: Convert country names to standard codes

Description Usage Arguments Details Value See Also

View source: R/countries.R

Description

Convert country names to standard codes

Usage

1
2
3
4
encode_country(x, code = c("iso2c", "iso3c", "iso.name", "un.name",
  "country.name", "fips.name", "genc.name", "continent"), ...)

encode_continent(x, ...)

Arguments

x

vector of country identifiers to convert

code

scheme for encoding countries in the output; default is ISO 2-letter code, but see ?countrycode::codelist for other choices

...

ignored

Details

All the heavy lifting is done by the countrycode package. This function will attempt to find matches for the input identifiers against a heirarchy of country encodings, starting with ISO 2-letter codes – so it should be idempotent with respect to already-encoded input.

Value

character vector of country identifiers in the requested encoding; missing or unmatched values will be NA. In the case of encode_continent(), a character vector of continents as assigned by the World Bank.

See Also

codelist, countrycode


andrewparkermorgan/rplasmodium documentation built on May 25, 2019, 6:26 p.m.