functional_beta {phyloregion}R Documentation

Functional beta diversity for mixed-type functional traits

Description

Computes turnover of functional diversity using k-prototypes clustering algorithm tailored for mixed-type functional traits (numeric and categorical) to generate an integer vector of cluster assignments. The ranges of each species in a cluster are collapsed to generate a new community matrix based on the presence or absence of cluster membership in a grid cell. A grade of membership model or beta diversity is then fitted to the new reduced community matrix for further analysis.

Usage

functional_beta(
  x,
  trait = NULL,
  bin = 10,
  na.rm = "no",
  quick_elbow = FALSE,
  abundance = FALSE,
  ...
)

Arguments

x

A dataframe or sparse community matrix of species occurrences.

trait

A data frame with the first column labeled “species” containing the taxonomic groups to be evaluated whereas the remaining columns contain the various functional traits. The variables should be mixed-type combining numeric and categorical variables.

bin

The desired number of clusters or bins. If elbow=TRUE, the optimal number of clusters is determined by running the analysis multiple times varying from 2 to bin.

na.rm

Logical, whether NA values should be removed prior to computation

quick_elbow

Quickly estimate the 'elbow' of a scree plot to determine the optimal number of clusters.

abundance

Logical, whether the reduced matrix should be returned as presence or absence of cluster representation or as abundances of cluster memberships

...

Further arguments passed to or from other methods.

Value

A list with three dissimilarity matrices capturing: (i) turnover (replacement), (ii) nestedness-resultant component, and (iii) total dissimilarity (i.e. the sum of both components).

For index.family="sorensen" the three matrices are:

For index.family="jaccard" the three matrices are:

References

Szepannek, G. (2018) clustMixType: User-friendly clustering of mixed-type data in R. The R Journal, 10: 200-208.

Examples


library(terra)
data(africa)
p <- vect(system.file("ex/sa.json", package = "phyloregion"))
fb <- functional_beta(x=africa$comm, trait = africa$trait)
p <- phyloregion(fb[[1]], pol = p)
plot(p)


[Package phyloregion version 1.0.8 Index]