Skip to contents

Compares Shannon diversity between samples.

Usage

test_diversity(object, ...)

# S4 method for matrix
test_diversity(object, adjust = "holm", ...)

# S4 method for data.frame
test_diversity(object, adjust = "holm", ...)

Arguments

object

A \(m \times p\) numeric matrix or data.frame of count data (absolute frequencies giving the number of individuals for each category, i.e. a contingency table). A data.frame will be coerced to a numeric matrix via data.matrix().

...

Further arguments to be passed to internal methods.

adjust

A character string specifying the method for adjusting \(p\) values (see stats::p.adjust()).

Value

A numeric

matrix.

Details

This test produces two sided pairwise comparisons: it returns a matrix of adjusted \(p\) values.

References

Magurran, A. E. (1988). Ecological Diversity and its Measurement. Princeton, NJ: Princeton University Press. doi:10.1007/978-94-015-7358-0 .

Author

N. Frerebeau

Examples

## Data from Conkey 1980, Kintigh 1989
data("cantabria")

## Shannon diversity test
test_diversity(cantabria)
#>                      Altamira Cueto de la Mina El Juyo El Cierro
#> Cueto de la Mina 8.268025e-02               NA      NA        NA
#> El Juyo          3.754291e-05       0.06016855      NA        NA
#> El Cierro        3.526160e-05       0.05708787       1        NA
#> La Paloma        3.255839e-05       0.01313679       1         1