plot_diversity_stats: Diversity plot with stats

View source: R/plot_diversity_stats.R

plot_diversity_statsR Documentation

Diversity plot with stats

Description

Diversity plot with stats

Usage

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",
  ...
)

Arguments

x

phyloseq-class object

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

Examples

## 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)

microsud/microbiomeutilities documentation built on Nov. 29, 2022, 12:18 a.m.