micro_forest: Create forest plots from negative binomial taxa models

Description Usage Arguments Value Examples

View source: R/micro_forest.R

Description

Create forest plots for specified coefficients in negative binomial taxa models. Plots estimated beta coefficients and confidence intervals

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
micro_forest(
  modsum,
  ...,
  main,
  ylab,
  xlab,
  subtitle,
  legend_title,
  legend_labs
)

Arguments

modsum

The output from nb_mods

...

The covariate you'd like to plot. Must be in the models created by nb_mods

main

The title for your plot

ylab

The label for the y-axis; default is "Taxa"

xlab

The label for the x-axis; default is output from function "TeX"

subtitle

The plot subtitle

legend_title

The title of the plot's legend

legend_labs

The names of the elements within the legend

Value

Returns a ggplot that you can add geoms to if you'd like

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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

## Creating negative binomial models on filtered tidi_micro set
nb_fam <- set %>%
otu_filter(prev_cutoff = 5, ra_cutoff = 0.1,
exclude_taxa = c("Unclassified", "Bacteria")) %>%
nb_mods(table = "Family", bpd1)

nb_fam %>% micro_forest(bpd1)

CharlieCarpenter/tidyMicro documentation built on April 25, 2021, 4:09 p.m.