Filters taxa and distributions data frames, and returns the filtered data and notes.
Arguments
- taxa
Data frame as returned by
get_taxa().- distributions
Data frame as returned by
get_distributions().- establishment_means
EstablishmentMeans to filter on. Only taxa with matching distributions with
establishmentMeansin this vector will be retained. Default is "introduced".
Value
A list with three data frames:
taxa: Filtered taxa data frame, with different columns than the inputtaxadata frame.distributions: Filtered distributions data frame.notes: Data frame with notes on taxa that were not included or replaced in the filtered data.
Filter on establishmentMeans
Defaults to NULL, which means no filter on establishmentMeans. Possible
values are "native", "introduced", "nativeReintroduced",
"introducedAssistedColonisation", "vagrant", "uncertain" and "nativeEndemic".
Filter details
Taxa are removed if
they are not matched with the GBIF backbone (i.e.,
nubKeyisNA),they do not have a matching distribution (i.e.,
taxonKeyis not indistributions$taxonKey),they do not have a matching distribution with
establishmentMeansinestablishment_means.
Synonyms are replaced by the accepted taxa they are synonyms of (i.e.,
taxonomicStatus is either "synonym", "ambiguous synonym",
"heterotypic synonym", "homotypic synonym", "misapplied" or
"proparte synonym).
scientificName is replaced with the scientific name matching the GBIF
backbone.
Taxa details
The taxa data frame in the output list has 6 variables:
taxonKey: GBIF taxon key ofscientificName. This value is replaced withacceptedKeyif the taxon is a synonym of an accepted taxon.nubKey: GBIF backbone taxon key.taxonID: Taxon ID ofscientificName, as provided in the checklist.scientificName: Scientific name of the taxon. This value is replaced withacceptedNamefor all records.kingdom: Kingdom of the taxon.taxonRank: Taxonomic rank of the taxon.
Examples
if (FALSE) { # \dontrun{
# Updated checklist of the ants in Belgium
datasetKey <- "32afaa9d-a27f-4885-b30c-ce08c34e1efb"
taxa <- get_taxa(datasetKey)
distributions <- get_distributions(datasetKey, taxa)
filter_data(taxa, distributions, establishment_means = "introduced" )
} # }