| region.tree | R Documentation |
Retrieves the species of a given clade recorded in an area from the Global
Biodiversity Information Facility (GBIF, via rgbif), then builds the
tree(s) with taxa.tree (inheriting the per-phylum split and
the source option). The area is specified in one of two ways:
region.tree(
taxon,
lat = NULL,
lon = NULL,
radius_km = NULL,
province = NULL,
gadm = NULL,
source = c("otl", "fish"),
max_species = 2000L,
plot = TRUE,
verbose = TRUE
)
taxon |
Required. A single clade name to constrain the search
(e.g. |
lat, lon, radius_km |
Radius mode: latitude, longitude (decimal degrees) and radius in kilometres. Supply all three. |
province |
Admin mode: a Canadian province/territory name or postal
code (e.g. |
gadm |
Admin mode: a GADM GID (e.g. |
source |
Passed to |
max_species |
Cap on the number of distinct species retrieved from GBIF (facet limit). Default 2000. |
plot, verbose |
Passed to |
Radius mode: a circle of radius_km around
(lat, lon).
Admin mode: an administrative area given by gadm
(a GADM GID, works worldwide) or province (a Canadian province
or territory name/abbreviation; all 13 are supported).
Invisibly, the taxa.tree result
(list(trees, unmatched)) with an added species element: the
distinct species names GBIF returned for the area.
Needs the suggested rgbif package (both modes) and geosphere (radius mode only). Both hit the network.
GBIF returns occurrence records, not a curated checklist. The result is presence-only and sampling-biased (some groups and places are far better recorded than others), so it reflects what has been observed and digitised, not a definitive species inventory. Only records with coordinates and without flagged geospatial issues are counted, but coordinate precision still varies. Treat the species list as a starting point, not ground truth.
The province lookup covers Alberta, British Columbia, Manitoba,
New Brunswick, Newfoundland and Labrador, Northwest Territories, Nova
Scotia, Nunavut, Ontario, Prince Edward Island, Quebec, Saskatchewan and
Yukon (and their postal codes). The GIDs follow GADM's alphabetical
level-1 ordering; the resolved GID is printed when verbose = TRUE.
If GBIF's GADM version ever disagrees, pass the GID directly via
gadm (browse them at
https://api.gbif.org/v1/geocode/gadm/browse/CAN).
taxa.tree, downto.tree
## Not run:
# Birds within 50 km of Montreal:
region.tree("Aves", lat = 45.50, lon = -73.57, radius_km = 50)
# Mammals of Nunavut (admin mode, Canadian territory):
region.tree("Mammalia", province = "Nunavut")
# Freshwater fishes of Quebec, as a dated tree:
region.tree("Actinopterygii", province = "QC", source = "fish")
# Anywhere in the world via a raw GADM GID:
region.tree("Reptilia", gadm = "USA.5_1")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.