Skip to contents

Shannon's H diversity index is a measure of the richness (abundance) evenness (balance or proportional abundance of each element). Thus, to use the example of a mixed cropping field. A field is more diverse if it has more crops grown in it and an equal area is allocated to each crop.

Usage

shannon_h_div(...)

Arguments

...

Two or more numeric vectors containing the proportion of a species. Each element (row) in the vector corresponds to a geographic unit or group that Shannon's H is calculated for.

Value

The Shannon's H diversity score for each unit; returned as a numeric vector.

Details

The function takes a series of numeric vectors as arguments. Each vector represents the proportion of species within a geographic unit or group. The function will check all input vectors are numeric. It will also rescale all row wise elements to sum to one. Any species with a zero proportion will be allocated a small proportion (0.00001) to enable Shannon's H to be computed.