View source: R/get_florabank_observations.R
get_florabank_observations | R Documentation |
This function takes as input a character vector with one or more names of species either as scientific names and/or Dutch names. By default (fixed = FALSE), partial matching will be used (the names are prepended and appended with %). The function queries the florabank, and returns a dataframe with observation level information about the matching taxa.
get_florabank_observations(connection, names, fixed = FALSE, collect = FALSE)
connection |
A connection to the florabank database. See the example section for how to connect and disconnect to the database. |
names |
Default missing. A character vector with scientific names and/or Dutch names. If fixed = TRUE, character strings are matched exactly and scientific names must include authorship in order to match. |
fixed |
Logical. If TRUE, names is to be matched as is (no partial matching) . |
collect |
If FALSE (the default), a remote |
A dataframe with the following variables:
NaamNederlands
,
NaamWetenschappelijk
,
AcceptedNaamWetenschappelijk
,
Bron
,
BeginDatum
,
EindDatum
,
Hok
,
Toponiem
,
CommentaarEvent
,
CommentaarWaarneming
,
EventID
,
X_event
,
Y_event
,
X_waarneming
,
Y_waarneming
Other florabank:
get_florabank_taxon_ifbl_year()
,
get_florabank_traits()
## Not run:
# code can only be run if a connection to the database is possible
library(inbodb)
# connect to florabank
db_connectie <- connect_inbo_dbase("D0152_00_Flora")
# query and collect the data using scientific name
succprat1 <- get_florabank_observations(db_connectie,
names = 'Succisa pratensis Moench', collect = TRUE)
# the same species but using Dutch name
succprat2 <- get_florabank_observations(db_connectie,
names = 'Blauwe knoop', collect = TRUE)
# providing both a Dutch name and scientific name will not duplicate records
# if they are the same species
succprat3 <- get_florabank_observations(db_connectie,
names = c("Succisa pratensis Moench", "Blauwe knoop"), collect = TRUE)
all.equal(succprat1, succprat2)
all.equal(succprat1, succprat3)
# passing dutch names and scientific names for different species
# is possible (records for each species is returned)
myspecies1 <- get_florabank_observations(db_connectie,
names = c('Succisa pratensis Moench', 'Gevlekte orchis'), collect = TRUE)
# passing multiple dutch names
myspecies2 <- get_florabank_observations(db_connectie,
names = c('Gevlekte orchis', 'Blauwe knoop'),
collect = TRUE)
all.equal(myspecies1, myspecies2)
# using default for collect will return a lazy query
# fixed = TRUE for exact matches only
myspecies3 <- get_florabank_observations(db_connectie,
names = c('Succisa pratensis Moench', 'Gevlekte orchis'),
fixed = TRUE)
# to collect the data for a lazy query you can also use the collect()
# function:
myspecies3 <- dplyr::collect(myspecies3)
# disconnect from florabank
dbDisconnect(db_connectie)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.