Learn R Programming

BAT (version 2.11.0)

hyper.build: Build hyperspace.

Description

Builds hyperspace using distance data for hull.build or kernel.build.

Usage

hyper.build(distance, ord = "pcoa", axes = 1, stats = FALSE)

Value

Either a matrix with the coordinates of each species in hyperspace or a list containing this matrix plus the stats for each dimension.

Arguments

distance

A dist object representing the distances between species.

ord

Method used to reduce the dimensionality of variables using either of the ordination methods "pcoa" or "nmds".

axes

If 0 < axes <= 1 a PCoA is done and as many axes as needed to achieve this proportion of variance explained are selected. If axes > 1 these many axes are selected for either PCoA or NMDS.

stats

If TRUE and ord = TRUE, stats for each dimension are returned.

Details

Note that each community should have at least 3 species and more species than traits or axes (if axes > 0) to build convex hull hypervolumes. Transformation of traits is recommended if (Carvalho & Cardoso, 2020):

  1. Some traits are not continuous;

  2. Some traits are correlated; or

  3. There are less species than traits + 1, in which case the number of axes should be smaller.

References

Carvalho, J.C. & Cardoso, P. (2020) Decomposing the causes for niche differentiation between species using hypervolumes. Frontiers in Ecology and Evolution, 8: 243.

Examples

Run this code
trait = data.frame(body = c(1,2,3,4,4), beak = c(1,5,4,1,2))
rownames(trait) = c("SpA", "SpB", "SpC", "SpD", "SpE")
distance = gower(trait)

hs = hyper.build(distance, axes = 0.8, stats = TRUE)
plot(hs$trait)
hs$stats
hs = hyper.build(distance, ord = "nmds", axes = 2, stats = TRUE)
plot(hs$trait)
hs$stats

Run the code above in your browser using DataLab