Learn R Programming

BAT (version 2.11.0)

hull.build: Build convex hull hypervolumes.

Description

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

Usage

hull.build(comm, trait)

Value

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

Arguments

comm

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

trait

A trait matrix, often resulting from hyper.build.

Examples

Run this code
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)

distance = gower(trait)
trait = hyper.build(distance)

hv = hull.build(comm[1,], trait)
plot(hv)
hvlist = hull.build(comm, trait)
plot(hvlist[[1]])
plot(hvlist[[2]])

Run the code above in your browser using DataLab