{BAT}R Documentation

Build convex hull hypervolumes.


Builds convex hull hypervolumes for each community from incidence and trait data.

Usage, trait, weight = NULL, axes = 0, convert = NULL)



A sites x species matrix, data.frame or vector, with incidence data about the species in the community.


A species x traits matrix or data.frame.


A vector of column numbers with weights for each variable. Its length must be equal to the number of columns in trait. Only used if axes > 0.


If 0, no transformation of data is done. If 0 < axes <= 1 a PCoA is done with Gower distances and as many axes as needed to achieve this proportion of variance explained are selected. If axes > 1 these many axes are selected.


A vector of column numbers, usually categorical variables, to be converted to dummy variables. Only used if axes > 0.


The hypervolumes can be constructed with the given data or data can be transformed using PCoA over Gower distances (Pavoine et al. 2009) after traits are dummyfied (if needed) and standardized (always). Beware that if transformations are required, all communities to be compared should be built simultaneously to guarantee comparability. In such case, one might want to first run and use the resulting data in different runs of See function for more details.


A 'convhulln' object or a list, representing the hypervolumes of each community.


comm = rbind(c(1,3,0,5,3), c(3,2,5,0,0))
colnames(comm) = c("SpA", "SpB", "SpC", "SpD", "SpE")
rownames(comm) = c("Site 1", "Site 2")

trait = data.frame(body = c(1,2,3,4,4), beak = c(1,5,4,1,2))
rownames(trait) = colnames(comm)

hv =[1,], trait)
hvlist =, trait)
hvlist =, trait, axes = 2, weight = c(1,2))

[Package BAT version 2.7.1 Index]