Function treeheight
finds the sum of lengths of connecting
segments in a dendrogram produced by hclust
, or other
dendrogram that can be coerced to a correct type using
as.hclust
. When applied to a clustering of species
traits, this is a measure of functional diversity (Petchey and Gaston
2002, 2006). Function treedive
finds the treeheight
for each site
(row) of a community matrix. The function uses a subset of dendrogram
for those species that occur in each site, and excludes the tree root
if that is not needed to connect the species (Petchey and Gaston
2006). The subset of the dendrogram is found by first calculating
cophenetic
distances from the input dendrogram, then
reconstructing the dendrogram for the subset of the cophenetic
distance matrix for species occuring in each site.
The functions need a dendrogram of species traits as an input. If
species traits contain factor
or ordered
factor variables, it is recommended to use Gower distances for mixed
data (function daisy
in package cluster),
and usually the recommended clustering method is UPGMA (method =
"average"
in function hclust
) (Podani and Schmera
2006).
It is possible to analyse the non-randomness of functional diversity
using oecosimu
. This provided specifying an adequate
Null model, and the results will change with this choice.