calc_cw_mean | R Documentation |
Calculate moments of trait distribution
calc_cw_mean(trait = NULL, weight = NULL)
calc_cw_variance(trait = NULL, weight = NULL, cw_mean = NULL)
calc_cw_skewness(
trait = NULL,
weight = NULL,
cw_mean = NULL,
cw_variance = NULL
)
calc_cw_kurtosis(
trait = NULL,
weight = NULL,
cw_mean = NULL,
cw_variance = NULL
)
calc_cw_moments(trait = NULL, weight = NULL)
trait |
numeric vector of trait values |
weight |
numeric vector of relative abundance or biomass |
cw_mean |
output from calc_cw_mean |
cw_variance |
output from calc_cw_variance |
a numeric vector
#vector of species abundance
abun <- rpois(n = 10, lambda = 3)
# vector of species trait
trait <- rnorm(n = 10, mean = 10, sd = 3)
calc_cw_moments(trait = trait, weight = abun)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.