shannon_index: Compute a Shannon index for diversity of equitability

View source: R/maxent.R

shannon_indexR Documentation

Compute a Shannon index for diversity of equitability

Description

Compute a Shannon index for diversity of equitability

Usage

shannon_index(
  x,
  type = c("proportion", "counts")[1],
  equitability = TRUE,
  base = exp(1),
  invert = c(NA, "reciprocal", "one-minus")[1],
  ...
)

Arguments

x

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

type

character, one of "proportion", "counts", etc.

equitability

logical, if TRUE (default) convert diversity to equitability which is just the normalized (0-1) diversity index

base

numeric, the base of the logarithm

invert

character, if equitabilty is TRUE then then invert using one-minus-equitability or 1/equitability. Ignored if NA

...

arguments for the diversity index function

Value

vector of diversity index values - one element for each record (row of input)


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