options(width = 100)
knitr::opts_chunk$set(out.width = "60%", fig.width = 6, fig.asp = 1, fig.align = "center")
library(naturecounts)

In the main data download functions for naturecounts, nc_data_dl() and nc_count(), you have the option of filtering data by region. In this article we will explore the various ways of specifying regional filters.

For more details regarding spatial limits to regions, see the articles:

In short

region must be a named list with one of the following:

To use the region argument:

nc_count(region = list(statprov = "NB"))

In Detail - Codes

Country

Search by name (English or French)

search_region("États-Unis", type = "country")

Browse the code list

meta_country_codes()

Use the resulting code(s)

nc_count(region = list(country = c("US", "CA")))

State/Province

Search by name (English, French, or Spanish)

search_region("Distrito de Colombia", type = "statprov")

Browse the code list

meta_statprov_codes()

Use the resulting code(s)

nc_count(region = list(statprov = c("DC", "MB")))

Subnational regions (type 2)

Search by name
Language depends on location: - Mexico = Spanish - USA = English - Quebec = French - Rest of Canada = English

search_region("Montreal", type = "subnational2")

Browse the code list

meta_subnational2_codes()

Use the resulting code(s)

nc_count(region = list(subnational2 = c("CA-QC-MR", "CA-ON-TO")))

Important Bird Areas (IBA)

Search by name (English or French)

search_region("oak hammock", type = "iba")

Browse the code list

meta_iba_codes()

Use the resulting code(s)

nc_count(region = list(iba = c("MB010", "AB011")))

Bird Conservation Regions (BCR)

Search by name (English, French, or Spanish)

search_region("rainforest", type = "bcr")

Browse the code list

meta_bcr_codes()

Use the resulting code(s)

nc_count(region = list(bcr = c(5, 2)))

UTM Squares

Browse the code list

meta_utm_squares()

Use the resulting code(s)

nc_count(region = list(utm_squares = "18TUR35"))

Bounding Box

Bounding box reflects latitude and longitude limits.

Use the resulting code(s)

nc_count(region = list(bbox = c(left = -125, bottom = 45, 
                                right = -100, top = 50)))


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