shannon_proportion_index: Compute the Shannon index from a table of contributions

View source: R/maxent.R

shannon_proportion_indexR Documentation

Compute the Shannon index from a table of contributions

Description

Compute the Shannon index from a table of contributions

Usage

shannon_proportion_index(x, base = exp(1), offset = c(1e-05, NA)[1])

Arguments

x

table or matrix of observations. If a matrix then, like a table, columns are variables and rows are records.

base

numeric, the base of the logarithm

offset

numeric, a small value to prevent taking the log of zero. If offset is NA or less than or equal to zero then zero-valued elements are removed. if offset greater than zero, then zero-valued elements in x are replaced with this value.

Value

vector of Shannon index - one element for each record

See Also

Wikipedia entry


BigelowLab/dismotools documentation built on Jan. 4, 2023, 11:24 a.m.