functcomp
computes the community-level weighted means of trait values for a set of communities (i.e. sites). For a continuous trait, CWM is the mean trait value of all species present in the community (after excluding species with NAs
), weighted by their relative abundances.
For ordinal, nominal and binary traits, either the dominant class is returned (when CWM.type
is "dom"
), or the abundance of each individual class is returned (when CWM.type
is "all"
).
The default behaviour of binary traits being treated as nominal traits can be over-ridden by specifying bin.num
, in which case they are treated as numeric traits.
When CWM.type = "dom"
, if the maximum abundance value is shared between two or more classes, then one of these classes is randomly selected for CWM. Because species with NAs
for a given trait are excluded for that trait, it is possible that when CWM.type
is set to "all"
, the sum of the abundances of all classes for a given ordinal/nominal/binary trait does not equal the sum of the species abundances. Thus, it is definitely not recommended to have NAs
for very abundant species, as this will lead to biased estimates of functional composition.