plot_alpha_diversities: Creat a plot for alpha diversities calculated using the...

View source: R/plot_alpha_diversities.R

plot_alpha_diversitiesR Documentation

Creat a plot for alpha diversities calculated using the microbiome package

Description

Utility plot function for diversity measures calcualted by microbiome package.

Usage

plot_alpha_diversities(
  x,
  type,
  index.val = "all",
  plot.type,
  variableA,
  palette
)

Arguments

x

phyloseq-class object.

type

Either alpha (Diversity Index) or dominance (Dominance Index) or evenness (Evenness Index)

index.val

see global function in microbiome package

plot.type

Three optons c("stripchart", "boxplot", "violin")

variableA

Variable of interested to be checked. This will also be used to color the plot

palette

Any of the RColorBrewer plettes

Details

Uses the microbiome package global function to calculate diversities and then returns a plot.

Value

ggplot object. This can be further modified using ggpubr

Examples

library(microbiome)
library(microbiomeutilities)
data("zackular2014")
p0 <- zackular2014
p <- plot_alpha_diversities(p0,
  type = "dominance",
  index.val = "all",
  plot.type = "stripchart",
  variableA = "DiseaseState",
  palette = "jco"
)

print(p)

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