Generates a sparse community matrix as input for clustering regions based on the similairity of functional traits across species.
counts(x, trait, cut = NULL, phy = NULL, bin = 10, na.rm = FALSE)
A community data in long format with one column representing sites labeled “grids” and another column representing species labeled “species”.
A data frame or matrix object with the first column labeled “species” containing the taxonomic groups to be evaluated whereas the remaining columns have the various functional traits. The variables must be a mix of numeric and categorical values.
The slice time.
is a dated phylogenetic tree with branch lengths stored as a phylo object (as in the ape package).
The desired number of clusters or bins.
Logical, whether NA values should be removed or not.
Function returns a community data frame that captures the count of each species based on its cluster membership.