boxplot_alpha: Alpha Boxplot

View source: R/boxplot_alpha.R

boxplot_alphaR Documentation

Alpha Boxplot

Description

Plot alpha index.

Usage

boxplot_alpha(
  x,
  x_var = NULL,
  index = NULL,
  violin = FALSE,
  na.rm = FALSE,
  show.points = TRUE,
  zeroes = TRUE,
  element.alpha = 0.5,
  element.width = 0.2,
  fill.colors = NA,
  outlier.fill = "grey50"
)

Arguments

x

phyloseq-class object

x_var

Metadata variable to map to the horizontal axis.

index

Alpha index to plot. See function alpha.

violin

Use violin version of the boxplot

na.rm

Remove NAs

show.points

Include data points in the figure

zeroes

Include zero counts in diversity estimation. Default is TRUE

element.alpha

Alpha value for plot elements. Controls the transparency of plots elements.

element.width

Width value for plot elements. Controls the transparency of plots elements.

fill.colors

Specify a list of colors passed on to ggplot2 scale_fill_manual

outlier.fill

If using boxplot and and points together how to deal with outliers. See ggplot2 outlier.fill argument in geom_ elements.

Details

A simple wrapper to visualize alpha diversity index.

Value

A ggplot plot object

Examples

data("dietswap")
p <- boxplot_alpha(dietswap, x_var = "sex", index="observed", violin=FALSE, 
                   na.rm=FALSE, show.points=TRUE, zeroes=TRUE, 
                   element.alpha=0.5, element.width=0.2, 
                   fill.colors= c("steelblue", "firebrick"),
                   outlier.fill="white")
p


microbiome/microbiome documentation built on Dec. 12, 2024, 2:45 p.m.