bartax: Taxonomic Composition Stacked Barcharts

View source: R/bartax.R

bartaxR Documentation

Taxonomic Composition Stacked Barcharts

Description

The bartax() function will create taxonomic composition barcharts. If desired, low-abundant taxonomic groups will be clustered into a single low abundant group.

Usage

bartax(
  x,
  xvar = "Sample",
  lowabun = 0.01,
  yvar = "Abundance",
  taxrank = "Genus",
  cols = NULL
)

Arguments

x

is a phyloseq object.

xvar

is a categorical variable selected from the metadata.

lowabun

is the cut off value for a low-abundant group. Set to NULL to not use.

yvar

is the relative abundance of reads.

taxrank

is the specified taxonomic rank.

cols

is a vector containing specified colour values (sufficient number for number of taxonomic groups).

Value

A ggplot object.

Examples

library(mirlyn)
data(example)
cols <- c("black","darkgoldenrod1","dodgerblue","deeppink4","chartreuse3",
   "burlywood4","navy","blueviolet", "tan2","lavenderblush3","cyan4")
bartax(example, "Sample", lowabun = 0.01, yvar = "Abundance", taxrank = "Phylum", cols)


escamero/mirlyn documentation built on Aug. 6, 2023, 9:30 p.m.