Learn R Programming

BAT (version 2.9.6)

kernel.hotspots: Hotspots in hypervolumes.

Description

Identify hotspots in kernel density hypervolumes based on minimum volume needed to cover a given proportion of random points.

Usage

kernel.hotspots(comm, prop = 0.5)

Value

A 'Hypervolume' or 'HypervolumeList' with the hotspots of each site.

Arguments

comm

A 'Hypervolume' or 'HypervolumeList' object, preferably built using function kernel.build.

prop

Proportion of random points to be included.

Details

Estimates the hotspots of one or more communities using kernel density hypervolumes as in Carmona et al. (2021).

References

Carmona, C.P., et al. (2021) Erosion of global functional diversity across the tree of life. Science Advances, 7: eabf2675. DOI: 10.1126/sciadv.abf2675

Examples

Run this code
if (FALSE) {
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 = kernel.build(comm[1,], trait)
plot(hv)
kernel.alpha(hv)

hot = kernel.hotspots(hv, 0.5)
plot(hot)
kernel.alpha(hot)

hvlist = kernel.build(comm, trait)
hot = kernel.hotspots(hvlist, 0.1)
kernel.alpha(hot)
}

Run the code above in your browser using DataLab