diversity {div}R Documentation

Calculate the diversity index

Description

This function calculates the entropy of a system with discrete states

Usage

diversity(x, prior = NULL)

Arguments

x

numeric vector, observed probabilities of the classes

prior

numeric vector, the prior probabilities of the classes

Value

the entropy or diversity measure

Examples

x <- c(0.4, 0.6)
diversity(x)

[Package div version 0.3.1 Index]