Check whether a COM(P)ADRE database contains one or more species of interest
Source:R/cdb_check_species.R
cdb_check_species.Rd
Takes a vector of species names and checks whether those species are
represented within a CompadreDB object. It outputs either a data frame
depicting the species of interest and whether they occur in the database
(TRUE/FALSE), or, if return_db == TRUE
, a CompadreDB object subset to
the species of interest.
Value
If return_db == FALSE
, returns a data frame with a column of
species names and a column indicating whether a species occurs in the
database. If return_db == TRUE
, returns a subset of cdb
containing only those species within argument species
.
See also
Other data checking:
cdb_collapse()
,
cdb_compare()
,
cdb_flag()
,
mpm_methods
Author
Danny Buss <dlb50@cam.ac.uk>
Owen R. Jones <jones@biology.sdu.dk>
Rob Salguero-Gomez <rob.salguero@zoo.ox.ac.uk>
Patrick Barks <patrick.barks@gmail.com>
Examples
species <- c("Primula vulgaris", "Trillium ovatum", "Homo sapiens")
cdb_check_species(Compadre, species)
#> species in_db
#> 1 Primula vulgaris TRUE
#> 2 Trillium ovatum TRUE
#> 3 Homo sapiens FALSE
CompadreSubset <- cdb_check_species(Compadre, species, return_db = TRUE)