View source: R/phy_plotTaxon_hist.R
| phy_plotTaxon_hist | R Documentation | 
Useful if you need a quick histogram or density plot of 1 or more taxa, which you can also color by another trait
phy_plotTaxon_hist( physeq, taxa, color_or_fill, transform = "clr", alpha = 1, geom = "histogram" )
| 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" | 
a ggplot2 object
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.