search_region: Find country, state/province, subnational2, IBA, or BCR codes

View source: R/search.R

search_regionR Documentation

Find country, state/province, subnational2, IBA, or BCR codes

Description

Search for the correct codes to identify countries, states/provinces, subnational2 areas, Important Bird Areas (IBA), or Bird Conservation Regions (BCR). These are then used in the nc_data_dl() and nc_count() functions.

Usage

search_region(name = NULL, type = "country")

Arguments

name

Character. The location name to search for

type

Character. One of "country", "statprov", "subnational2", "iba", or "bcr". The type of information to return.

Details

region_search() is deprecated in favour of search_region()

Value

A data frame with the relevant codes and other information

Examples


search_region("Mexico", type = "country")   # MX

search_region("Yucatan", type = "statprov") # Yucatán
search_region("Alberta", type = "statprov") # AB

search_region("Edmonton", type = "subnational2") # CA.AB.11
search_region("Brandon", type = "subnational2")  # CA.MB.07

search_region("hays reservoir", type = "iba") # AB075
search_region("rainforest", type = "bcr")     # 5


# Show all codes
search_region(type = "country")
search_region(type = "statprov")
search_region(type = "subnational2")
search_region(type = "iba")
search_region(type = "bcr")


# Using the codes
nc_count(region = list(statprov = "AB"), years = 2010)



BirdStudiesCanada/rNatureCounts documentation built on July 3, 2023, 2:06 a.m.