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\) matrix of count data.

...

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 .

See also

Other statistics: independance

Author

N. Frerebeau

Examples

## Shannon diversity test
data("merzbach", package = "folio")
test_diversity(merzbach)
#>              VII         VIII         IX           X           XI        XII
#> VIII 1.26614e-05           NA         NA          NA           NA         NA
#> IX   0.00000e+00 1.249517e-05         NA          NA           NA         NA
#> X    0.00000e+00 1.398881e-14 0.01022721          NA           NA         NA
#> XI   0.00000e+00 0.000000e+00 0.01402263 1.000000000           NA         NA
#> XII  0.00000e+00 2.109424e-11 0.62031967 0.222814267 3.542942e-01         NA
#> XIII 0.00000e+00 8.820100e-05 1.00000000 0.000088201 6.030522e-05 0.04368293
#> XIV  0.00000e+00 5.325949e-09 0.61538958 0.711863831 1.000000e+00 1.00000000
#>            XIII
#> VIII         NA
#> IX           NA
#> X            NA
#> XI           NA
#> XII          NA
#> XIII         NA
#> XIV  0.07722331