Description Usage Arguments Details Value Examples
View source: R/places_lookup.R
A helper function to navigate two letter country codes. The geonames dump file places_table
uses two letter country codes (iso2c). The places_table
includes optional country and region names. If you prefer to look up country codes then use this helper. The function wraps the countrycode
lookup function for matching single country names or vectors to two letter country codes. Country and region names are not case sensitive.
1 | places_lookup(name = NULL, type = "country")
|
name |
A country, region or subregion name. |
type |
Either "country", "region", "subregion" or "intermediate" |
The region, subregion and intermediate searches are mainly intended for use with the allcountries table to group countries by United Nations regions. The function wraps the countrycode package on CRAN function countrycode
UN Regions
Africa
Americas
Asia
Europe
Oceania
UN Subregion
Australia and New Zealand
Central Asia
Eastern Asia
Eastern Europe
Latin America and the Caribbean
Melanesia
Micronesia
Northern Africa
Northern America
Northern Europe
Polynesia
South-eastern Asia
Southern Asia
Southern Europe
Sub-Saharan Africa
Western Asia
Western Europe
UN Intermediate Region
Caribbean
Central America
Channel Islands
Eastern Africa
Middle Africa
South America
Southern Africa
Western Africa
A vector containing a country name or set of two letter country codes for a region or subregion.
1 2 3 4 5 6 7 8 9 | ## Not run: one <- places_lookup("UK", type = "country"),
two <- places_lookup(c("US", "UK"), type = "country"),
two_names <- places_lookup(c("Kenya", "Tanzania"))
upper <- places_lookup("Africa", type = "region")
africa <- places_lookup("africa", type = "region"),
central_asia <- places_lookup("Central Asia", type = "subregion"),
caribbean <- places_lookup("Caribbean", type = "intermediate")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.