Description Usage Arguments Details Value See Also
Convert country names to standard codes
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, ...)
|
x |
vector of country identifiers to convert |
code |
scheme for encoding countries in the output; default is ISO 2-letter code, but
see |
... |
ignored |
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.
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.
codelist, countrycode
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.