phy_plotTaxon_hist: Quick histogram of taxa

View source: R/phy_plotTaxon_hist.R

phy_plotTaxon_histR Documentation

Quick histogram of taxa

Description

Useful if you need a quick histogram or density plot of 1 or more taxa, which you can also color by another trait

Usage

phy_plotTaxon_hist(
  physeq,
  taxa,
  color_or_fill,
  transform = "clr",
  alpha = 1,
  geom = "histogram"
)

Arguments

physeq

a phyloseq object

taxa

a character, the ID(s) of the taxa to plot

color_or_fill

a character, the variable to color or fill the histogram or the density plot by

transform

a character to transform the taxa with, any from "phy_transform" are allowed

alpha

a double, transparency of the plot elements: between 0 (completely transparent) and 1 (full density)

geom

character, either "histogram" or "density"

Value

a ggplot2 object

Examples


data("GlobalPatterns")

# fix a bug in the ggplot2 code, which does not accept numeric variables as string names
taxa_names(GlobalPatterns) <- paste0("t",taxa_names(GlobalPatterns))

phy_plotTaxon_hist(physeq = GlobalPatterns, taxa = "t549656", color_fill = "SampleType", geom="density")
phy_plotTaxon_hist(physeq = GlobalPatterns, taxa = "t549656", color_fill = "SampleType", geom="histogram")


g-antonello/gautils2 documentation built on Nov. 28, 2022, 9:39 a.m.