resolve_country: Get ISO 3166-1 country code.

View source: R/utils.R

resolve_countryR Documentation

Get ISO 3166-1 country code.

Description

Country identity can be provided as a number or as country name. If the provided number is a valid ISO 3166-1 country code it is returned directly.

Usage

resolve_country(country, full.name = FALSE)

Arguments

country

Character country name or numeric country code.

full.name

Logical should the full name of the country be returned? (default: FALSE)

Details

Package countrycode is used to resolve the value of argument country which can be either a country name (country.name) or a ISO 3166-1 country code (iso3n).

Value

Numeric count of the species whose range intersects with the country.

Author(s)

Joona Lehtomaki <joona.lehtomaki@gmail.com>

See Also

countrycode

Examples


# Using country name
code <- resolve_country("Finland")
  
# Using country code (156 is China)
code <- resolve_country(156)
# Getting the full name
country.name <- resolve_country(156, full.name=TRUE)

# Country code can be provided as a character string as well
code <- resolve_country("156")


ropensci/rdopa documentation built on May 18, 2022, 6:32 p.m.