populateTraits.Rd
Generic function to fill medfate species trait parameters from a data table of species traits
populateTraits(
SpParams,
trait_table,
trait_mapping,
taxon_column,
genus_column = NULL,
character_traits = FALSE,
summary_function = "median",
summary_params = list(na.rm = TRUE),
scalar_functions = NULL,
replace_previous = FALSE,
erase_previous = FALSE,
verbose = FALSE
)
A data frame of medfate species parameters to be populated.
A data frame with functional traits in columns and plants in rows.
A named string vector specifying which trait data column should be used to populate each medfate param. Elements are data base columns and names are medfate params.
A string identifying the column in trait_table
that identifies taxon names).
A string identifying the column in trait_table
that identifies genus. If NULL
then genus are taken from first word of taxon names.
Boolean flag to treat traits as character-valued
A function to summarize multiple values for the same taxonomic entity. By default, median values are taken for quantitative traits and the most frequent value is taken for qualitative traits.
A list of summary function params (by default na.rm=TRUE
).
A named list of scalar functions for traits needing transformation of units or scaling. Names are medfate params.
A boolean flag to indicate that non-missing previous values should be replaced with new data
A boolean flag to indicate that all previous values should be set to NA before populating with new data
A boolean flag to indicate extra console output
A modified data frame of medfate species parameters
Matches column 'AcceptedName' of SpParams with trait parameter sources. If the target taxon is a species, values are taken from those rows in trait_table where species names match. If the target taxon is a genus, then values are taken from those rows where genus is the same.