calc_cw_mean: Calculate moments of trait distribution

calc_cw_meanR Documentation

Calculate moments of trait distribution

Description

Calculate moments of trait distribution

Usage

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)

Arguments

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

Value

a numeric vector

Examples

#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)

alaindanet/ecocom documentation built on Nov. 5, 2023, 8:25 a.m.