Diversity plot with stats
plot_diversity_stats(
x,
index,
group = NULL,
group.colors = c("brown3", "steelblue"),
dot.opacity = 0.25,
box.opacity = 0.25,
violin.opacity = 0.5,
group.order = NULL,
stats = TRUE,
label.format = "p.format",
...
)
phyloseq-class
object
diversity index. Calculated using microbiome::alpha
Grouping variable to compare
Colors for plotting groups
for ggplot alpha to determine opacity for points
for ggplot alpha to determine opacity for box
for ggplot alpha to determine opacity for violin
Default is NULL. a list specifing order of x-axis.
Logical TRUE or FALSE. Calls ggpubr::stat_compare_means.
For ggpubr::stat_compare_means "p.signif" E.g. c("H","CRC","nonCRC")
params for ggpubr::stat_compare_means
if (FALSE) {
library(microbiomeutilities)
library(ggpubr)
data("zackular2014")
p0 <- zackular2014
mycols <- c("brown3", "steelblue", "grey50")
p.m <- plot_diversity_stats(p0,
group = "DiseaseState",
index = "diversity_shannon",
group.order = c("H", "CRC", "nonCRC"),
group.colors = mycols
)
print(p.m)
}