View source: R/plot_diversity_stats.R
plot_diversity_stats | R Documentation |
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", ... )
x |
|
index |
diversity index. Calculated using microbiome::alpha |
group |
Grouping variable to compare |
group.colors |
Colors for plotting groups |
dot.opacity |
for ggplot alpha to determine opacity for points |
box.opacity |
for ggplot alpha to determine opacity for box |
violin.opacity |
for ggplot alpha to determine opacity for violin |
group.order |
Default is NULL. a list specifing order of x-axis. |
stats |
Logical TRUE or FALSE. Calls ggpubr::stat_compare_means. |
label.format |
For ggpubr::stat_compare_means "p.signif" E.g. c("H","CRC","nonCRC") |
... |
params for ggpubr::stat_compare_means |
## Not run: 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) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.