cwm | R Documentation |
This function calculates the community-weighted means of trait categories.
cwm(x, trait_db = NULL, tax_lev = "Taxa", trans = log1p, traceB = FALSE)
x |
Result of |
trait_db |
A trait |
tax_lev |
Character string giving the taxonomic level used to retrieve
trait information. Possible levels are |
trans |
Function for transforming the abundances, by default
|
traceB |
When set to |
This function first takes the abundance table corresponding to the desired
taxonomic level from the x
object generated with aggregate_taxa()
.
The community mean trait values are calculated using the transformed
abundances (using the trans
function) as weigths.
a table with the CWM values of each trait (trait modality)
Tachet, H., Richoux, P., Bournaud, M., & Usseglio-Polatera, P. (2010). Invertebres d'eau douce: systematique, biologie, ecologie. Paris: CNRS editions.
Schmidt-Kloiber, A., & Hering, D. (2015). www. freshwaterecology. info-An online tool that unifies, standardises and codifies more than 20,000 European freshwater organisms and their ecological preferences. Ecological indicators, 53, 271-282.
aggregate_taxa
data(macro_ex)
data_bio <- as_biomonitor(macro_ex)
data_agr <- aggregate_taxa(data_bio)
data_ts <- assign_traits(data_agr)
# averaging
data_ts_av <- average_traits(data_ts)
# community specialization index
cwm(x = data_agr, trait_db = data_ts_av, tax_lev = "Taxa", trans = log1p)
cwm(
x = data_agr, trait_db = data_ts_av, tax_lev = "Taxa",
trans = function(x) {
ifelse(x > 0, 1, 0)
}
)
cwm(x = data_agr, trait_db = data_ts_av, tax_lev = "Genus", trans = log1p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.