diversity: Hill Diversity

View source: R/diversity.R

diversityR Documentation

Hill Diversity

Description

Compute Hill diversity from proportional abundances.

Usage

diversity(p, alpha = 2)

Arguments

p

Numeric vector or matrix of proportional abundances. If vector, then Hill diversity is computed for the vector of proportions (and a scalar is returned). If matrix, then Hill diversity is computed independently for each record (and a vector is returned).

alpha

Numeric scalar or vector. Continuous positive alpha parameter of the Hill diversity formula. If scalar, then alpha is recycled for each record of matrix p. If vector, then each element of alpha is applied to the corresponding record of matrix p. With the default of alpha = 2, Hill diversity is equal to the inverse Simpson index.

Details

Calculates Hill diversity from proportional abundances as defined in Hill (1973), which provides a unifying theory for ecological diversity indices. When alpha = 0, Hill diversity is equal to species richness. When alpha = 1, Hill diversity is equal to the exponentiated Shannon's entropy. When alpha = 2 (the default), Hill diversity is equal to the inverse of Simpson's index. For any value of alpha, the Hill diversity of a community with uniform proportional abundances is equal to species richness. Hill diversity represents the effective number of species.

Value

Numeric scalar or vector of Hill diversity values.

References

Hill MO. 1973. Diversity and evenness: A unifying notation and its consequences. Ecology, 54(2): 427-432. DOI: 10.2307/1934352

See Also

dissimilarity for computing Bray-Curtis dissimilarity from proportional abundances.

richness for computing species richness from occupancy probabilities.

Examples

# Compute Hill diversity.
diversity(p=c(0.15,0.25,0.4,0.2))

LocaTT documentation built on June 14, 2026, 1:06 a.m.