| country | R Documentation |
This function returns country and region designations used by the toponym package.
country(query = NULL, ...)
query |
character string vector. Enter queries to access information on countries. |
... |
Additional parameter:
|
If you enter an individual country designation, you receive the three different designations (IS02, ISO3, name).
If you enter "ISO2" or "ISO3", you receive a vector of all ISO-codes of the respective length.
If you enter "names", you receive a vector of all country names.
If you enter "country table", you receive a data frame with all three designations for every country.
Region designations are retrieved from the geodata package map data. The list of region designations may be incomplete. For mapping purposes, geodata is used throughout this package.
If regions is set to value higher than 0, map data by the geodata is required to be downloaded.
With toponymOptions(), users can specify the path for toponym and map data downloaded by this package across sessions. See help(toponymOptions).
Returns country designations selected from a data frame. If regions is set to 1, returns region designations in a matrix selected from the geodata map data.
country(query = "ISO3")
## returns a vector of all ISO3 codes
country(query = "Thailand")
## returns a list with a data frame with ISO2 code, ISO3 code and the full name of Thailand
## We recommend setting a persistent path for downloaded data by using toponymOptions()
## Users can always set the path manually when a function is used
## For illustration purposes,
## 1. the path is manually set each time
## 2. and wrapped in donttest because data will be downloaded in the following example:
country(query = "Thailand", regions = 1, toponym_path = tempdir())
## returns a list with a matrix with all region designations of Thailand
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.