convert_to_iso2Code | R Documentation |
'convert_to_iso2Code' accepts the type of country input and the country, and returns the relevant iso2Code
convert_to_iso2Code(country_input_type_string, country, countries_dataframe)
country_input_type_string |
Either "country_name" or "iso2Code" - use country_input_type(country, countries_dataframe) to determine or assign manually. |
country |
A country/region name or iso2Code. |
countries_dataframe |
The output of show_countries() |
A character vector containing a valid iso2Code
## Not run:
# Assign so as to save on API calls (recommended)
countries_dataframe <- show_countries()
country <- "Australia"
country_input_type_string <- country_input_type(country, countries_dataframe)
convert_to_iso2Code(country_input_type_string, country, countries_dataframe)
# [1] "AU"
country <- "AU"
country_input_type_string <- country_input_type(country, countries_dataframe)
convert_to_iso2Code(country_input_type_string, country, countries_dataframe)
# [1] "AU"
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.