countryConversion | R Documentation |
Converts a vector of country names or codes from one system to
another returning NA
where no match is found.
countryCodeToName(countryCode = NULL)
countryCodeToFIPS(countryCode = NULL)
countryFIPSToName(countryFIPS = NULL)
countryFIPSToCode(countryFIPS = NULL)
countryNameToCode(countryName = NULL)
countryNameToFIPS(countryName = NULL)
countryCode |
Vector of ISO 3166-1 alpha-2 codes. |
countryFIPS |
Vector of two-character FIPS codes. |
countryName |
Vector of English language country names. |
A vector of country names or codes.
library(MazamaSpatialUtils)
# FIPS codes are different!
countryNameToCode("Germany")
countryNameToFIPS("Germany")
countryCodeToName("CH")
countryFIPSToName("CH")
countryCodes <- sample(SimpleCountries$countryCode, 30)
data.frame(
name = countryCodeToName(countryCodes),
code = countryCodes,
FIPS = countryCodeToFIPS(countryCodes)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.