Learn R Programming

tidyMicro (version 1.47)

taxa_boxplot: Function to make boxplots of taxa counts or relative abundance

Description

A function to make boxplots of one specified taxa relative abundance with the option to stratify by a factor variable

Usage

taxa_boxplot(
  micro_set,
  taxa,
  ...,
  y = ra,
  xlab = NULL,
  ylab = NULL,
  main = NULL,
  subtitle = NULL,
  legend_title = NULL
)

Arguments

micro_set

A tidy_micro data set

taxa

A character string. The name of the taxa of interest

...

The factor variable you'd like to stratify by

y

The taxa information

xlab

x-axis label

ylab

y-axis label

main

Plot title

subtitle

Subtitle for the plot

legend_title

Title of plot legend

Value

A ggplot that you can add geoms to if you'd like

Examples

Run this code
# NOT RUN {
data(bpd_phy); data(bpd_cla); data(bpd_ord); data(bpd_fam); data(bpd_clin)

otu_tabs <- list(Phylum = bpd_phy, Class = bpd_cla,
Order = bpd_ord, Family = bpd_fam)
set <- tidy_micro(otu_tabs = otu_tabs, clinical = bpd_clin) %>%
filter(day == 7) ## Only including the first week

set %>%
taxa_boxplot("Firmicutes/Bacilli/Bacillales/Staphylococcaceae", bpd1)
# }

Run the code above in your browser using DataLab