find_species_traits: Find traits and taxonomic information for a list of species

Description Usage Arguments Details Value Examples

View source: R/find_species_traits.R

Description

This function takes a list of species, collects taxonomic information for them, and then searches the databases for the valid scientific names, as well as any synonyms that were found.

Usage

1
2
find_species_traits(databases, species, traits = NULL,
  get_common_names = FALSE)

Arguments

species

A vector of species names in the format "Genus species". Note: if the same name is given more than once, the extra occurances are discarded. Consequently, you cannot be guaranteed that the number of rows in the resulting dataframe has the same length as the number of species that were given.

Note that it also removes duplicate species names that are given. It only takes species names, NOT genus or family names. If genus or other taxonomic ranks are given, they are ignored.

traits=NULL

A list of trait databases, with each value being a vector of column names. Eg. list( "fishbase" = c( "Weight" ) ) to search fishbase and include the Weight column in the output. If NULL, then all databases and all columns will be selected.

get_common_names=NULL

Whether to get common name information as well. This significantly increases the time that this function takes to run.

Details

The main difference between this function, and Databases::search(), is that it also collects taxonomic information, and searches the databases for synonyms.

It returns a dataframe with the following columns: - taxa: the species name given in the species argument - found: whether or not the species name was recognised by the Catalogue of Life (https://www.catalogueoflife.org/) taxonomic database. - colid: the ID for the taxonomic name in the Catalogue of Life - synonyms: any synonyms found - accepted_name: the accepted name for the species (according to Catalogue of Life) - common_name: the common name(s) of the species - kingdom, phylum, class, order, family, genus: taxonomic information when available

In addition, it includes all the columns selects via the traits argument. Columns are preprended with database author's name to ensure that the source of the information can be traced and appropriately cited.

Value

A list with list[["results"]] being a dataframe containing the list of species and any matched trait data from the selected columns; and list[["statistics"]] being a dataframe containing the number of matches and number of columns selected from each database.

Examples

1
2
3
find_species_traits( c("Betta splendens"), list( "fishbase" = c( "Weight" ) ))
find_species_traits( c("Betta splendens"), list( "pacifici_generationlength" = c( "GenerationLength_d" ) ))
find_species_traits( c("Betta splendens"))

conservationscience/functionaltraits documentation built on May 22, 2020, 3:25 a.m.