Learn R Programming

OasisR (version 3.1.0)

HShannon: A function to compute Shannon-Wiener diversity (entropy) index

Description

The Shannon-Wiener diversity index is based on the notion of entropy and measures population heterogeneity.

Usage

HShannon(x)

Value

Shannon-Wiener diversity index

Arguments

x

- an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group.

References

Shannon C. E. (1948) A mathematical theory of communication. Bell System Technical Journal (27)

See Also

Social diversity indices: NShannon, ISimpson,

Multi-group indices: PMulti, GiniMulti, DMulti, HMulti, CMulti, RelDivers

Examples

Run this code
x <- segdata@data[ ,1:2]
HShannon(x) 

Run the code above in your browser using DataLab