D0156_00_Taxonlijsten
R/get_taxonlijsten_items.R
get_taxonlijsten_items.Rd
This function queries D0156_00_Taxonlijsten
and gives an
overview of the taxa that are on a given taxon list version. The interpreted
taxa are given by default, but it is possible to add taxa as they were
originally published. The taxa of the latest list version are shown
unless specified otherwise.
get_taxonlijsten_items(
connection,
list = "%",
taxon = "%",
feature = "%",
version = c("latest", "old", "all"),
original = FALSE,
collect = FALSE
)
dbconnection with the database D0156_00_Taxonlijsten
on the inbo-sql07-prd server
name of the taxonlist that you want to retrieve. Wildcards % are allowed. Case insensitive.
name of the taxon you want to retrieve. Scientific and vernacular (Dutch) names are allowed. Wildcards % are allowed. Case insensitive.
name of the list feature (actually feature code) you want to retrieve. Wildcards % are allowed. Case insensitive.
A choice ('latest', 'old', 'all'). If 'latest' (the default) only the most recent version is returned. If 'old' all but the most recent version is returned. If 'all' all versions are returned.
If FALSE (the default), the function will only retrieve the interpreted taxa. If TRUE, columns with the original taxa will be added to the output. For example, if the originally published taxon on a taxonlist is 'Cicindela spec.', the interpretation will exist of all relevant Cicindela species
If FALSE (the default), a remote tbl object is returned. This is like a reference to the result of the query but the full result of the query is not brought into memory. If TRUE the full result of the query is collected (fetched) from the database and brought into memory of the working environment.
A remote tbl object (collect = FALSE) or a tibble dataframe (collect = TRUE) with variables Lijst, Publicatiejaar, LaatsteVersie, Taxongroep, Naamwet_interpretatie, Auteur, NaamNed_interpretatie, Kenmerk, KenmerkwaardeCode, Kenmerkwaarde and extra variables Taxongroep_origineel, Naamwet_origineel, Naamned_origineel when requested (original = TRUE)
Other taxonlijsten:
get_taxonlijsten_features()
,
get_taxonlijsten_lists()
if (FALSE) { # \dontrun{
library(inbodb)
library(tidyverse)
con <- connect_inbo_dbase("D0156_00_Taxonlijsten")
# Get all taxa from list 'Jachtdecreet'
get_taxonlijsten_items(con, list = 'Jachtdecreet', collect = TRUE)
# Get all taxa on category 2 of 'Soortenbesluit'
get_taxonlijsten_items(con, list = 'soortenbesluit', feature = 'cat2')
# Get all taxonlist that include 'Gentiaanblauwtje'
get_taxonlijsten_items(con, taxon = 'Gentiaanblauwtje', collect = TRUE)
# Get all taxa with red list status CR (critically endangered)
get_taxonlijsten_items(con, feature = 'CR')
# Get original and interpreted Cicindela taxa from list 'Soortenbesluit'
get_taxonlijsten_items(con, list = 'Soortenbesluit', taxon = '%Cicindela%'
, original = TRUE) %>%
select('Naamwet_origineel', 'NaamNed_origineel', 'Naamwet_interpretatie'
, 'NaamNed_interpretatie')
# Compare red list status on multiple listversions
get_taxonlijsten_items(con, version = 'all'
, list = 'rode lijst van de dagvlinders') %>%
select('Lijst', 'Publicatiejaar', 'Naamwet_interpretatie'
, 'NaamNed_interpretatie', 'KenmerkwaardeCode') %>%
pivot_wider(names_from = Publicatiejaar, values_from = KenmerkwaardeCode)
# Close the connection when done
dbDisconnect(con)
rm(con)
} # }