knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(ecocom)

Weight

abun <- rpois(n = 10, lambda = 3)

scaled <- scale_weight(abun)

c(base = sum(abun), scaled = scaled)

Compute moment of trait distributions

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