divent_hill_matrix_pq: Compute Hill diversity numbers for all samples in an OTU...

View source: R/hill_helpers.R

divent_hill_matrix_pqR Documentation

Compute Hill diversity numbers for all samples in an OTU table

Description

Iterates over all samples in an OTU table and computes Hill diversity numbers using divent::div_hill().

Usage

divent_hill_matrix_pq(comm, q, ...)

Arguments

comm

(data.frame or matrix) OTU table with samples as rows and taxa as columns.

q

(numeric vector) Hill diversity orders to compute. Hill numbers are more appropriate in DNA metabarcoding studies when q > 0 (Alberdi & Gilbert, 2019; Calderón-Sanou et al., 2019).

...

Additional arguments passed to divent::div_hill() (e.g. estimator = "naive" to reproduce vegan-equivalent results).

Value

A data.frame with one row per sample and one column per value in q. Column names are the string representation of the q values. Row names match the input row names.

References

Alberdi, A., & Gilbert, M. T. P. (2019). A guide to the application of Hill numbers to DNA-based diversity analyses. Molecular Ecology Resources. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/1755-0998.13014")}

Calderón-Sanou, I., Münkemüller, T., Boyer, F., Zinger, L., & Thuiller, W. (2019). From environmental DNA sequences to ecological conclusions: How strong is the influence of methodological choices? Journal of Biogeography, 47. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/jbi.13681")}

See Also

divent::div_hill(), hill_pq(), hill_tuckey_pq()

Examples

data("data_fungi_mini", package = "MiscMetabar")
data_f <- prune_samples(
  sample_names(data_fungi_mini)[1:5],
  data_fungi_mini
)
otu <- as.data.frame(phyloseq::otu_table(
  taxa_as_columns(data_f)
))
divent_hill_matrix_pq(otu, q = c(0, 1, 2))

MiscMetabar documentation built on June 8, 2026, 5:07 p.m.