View source: R/gbif_has_distribution.R
gbif_has_distribution | R Documentation |
This function compares GBIF distribution information based on a single taxon
key with user requests and returns a logical (TRUE or FALSE). Comparison is
case insensitive. User properties for each term are treated as OR.
It is a function built on rgbif function name_usage()
.
gbif_has_distribution(taxon_key, ...)
taxon_key |
(single numeric or character) a single taxon key. |
... |
one or more GBIF distribution properties and related values. Up to now it supports the following properties: country (and its synonym: countryCode), status (and its synonym: occurrenceStatus) and establishmentMeans. |
a logical, TRUE or FALSE.
## Not run:
# IMPORTANT!
# examples could fail as long as `status` (`occurrenceStatus`) is used due to
# an issue of the GBIF API: see https://github.com/gbif/gbif-api/issues/94
# numeric taxonKey, atomic parameters
gbif_has_distribution(145953242,
country = "BE",
status = "PRESENT",
establishmentMeans = "INTRODUCED"
)
# character taxonKey, distribution properties as vectors, treated as OR
gbif_has_distribution("145953242",
country = c("NL", "BE"),
status = c("PRESENT", "DOUBTFUL")
)
# use alternative names: countryCode, occurrenceStatus.
# Function works. Warning is given.
gbif_has_distribution("145953242",
countryCode = c("NL", "BE"),
occurrenceStatus = c("PRESENT", "DOUBTFUL")
)
# Case insensitive
gbif_has_distribution("145953242",
country = "be",
status = "PRESENT",
establishmentMeans = "InTrOdUcEd"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.