match_countries: Match country names to their equivalent naturalearth WKT...

View source: R/utils-validation.R

match_countriesR Documentation

Match country names to their equivalent naturalearth WKT polygons

Description

Match country names to their equivalent naturalearth WKT polygons using rnaturalearth::ne_countries().

Usage

match_countries(countrynames, returnmulti = TRUE, onlywkt = FALSE)

Arguments

countrynames

a vector of country names to match to naturalearth.

returnmulti

return the GBIF taxon ids only (otherwise return the full lookup dataframe).

onlywkt

only return location_wkt (see note for more details).

Value

A list containing:

  • ⁠$location_wkt⁠: a multipolygon containing all locations (or a named vector of individual country polygons).

  • ⁠$missing_locs⁠: any provided countries not found in naturalearth.

  • ⁠$found_locs⁠: any provided countries that were found in naturalearth.

Author(s)

Francis Windram

Examples

match_countries(c("United Kingdom", "Germany"))


ohvbd documentation built on March 10, 2026, 1:07 a.m.