z_diversity {pctax} | R Documentation |
Calculate Zeta Diversity
Description
This function calculates Zeta diversity for each group in the provided otutab.
This function plots the Zeta diversity results obtained from the z_diversity function.
Usage
z_diversity(otutab, group_df = NULL, zetadiv_params = list())
## S3 method for class 'zeta_res'
plot(x, lm_model = c("exp", "pl")[1], ribbon = FALSE, text = TRUE, ...)
Arguments
otutab |
A matrix or data frame containing OTU (Operational Taxonomic Unit) counts. |
group_df |
A data frame containing group information. |
zetadiv_params |
Additional parameters to be passed to the Zeta.decline.mc function from the zetadiv package. |
x |
Zeta diversity results obtained from z_diversity function. |
lm_model |
The linear model to be used for fitting ('exp' or 'pl'). |
ribbon |
Logical, whether to add a ribbon to the plot for standard deviation. |
text |
Logical, whether to add R-squared and p-value text annotations. |
... |
Additional arguments to be passed to ggplot2 functions. |
Value
zeta_res
A ggplot object.
Examples
if (requireNamespace("zetadiv")) {
data(otutab, package = "pcutils")
zeta_result <- z_diversity(otutab, metadata["Group"], zetadiv_params = list(sam = 10))
plot(zeta_result, lm_model = "exp", text = TRUE)
}
[Package pctax version 0.1.1 Index]