create_bar: Create a per-sample barplot of the top _n_ OTUs/ASVs

Description Usage Arguments Value Examples

View source: R/create_bar.R

Description

Takes either a phyloq-object or an (edited) result of prep_bar as an input. And creates a per-sample barplot.

Usage

1
2
3
4
5
6
7
8
9
create_bar(
  ps = NULL,
  df_topn = NULL,
  id = "sample_id",
  n = 15,
  ncol_legend = 3,
  name_legend = "OTU",
  RA = TRUE
)

Arguments

ps

phyloseq-object (optional)

df_topn

topn-data.frame (result of prep_bar)

id

name of the 'id'-column (default: 'sample_id')

n

number of OTUs/ASVs to plot

ncol_legend

number of columns in the legend

name_legend

name of the legend

RA

specify whether or not the phyloseq is based on relative abundances (logical). Default: TRUE

Value

returns a per-sample barplot showing the n most abundant OTUs.

Examples

1
2
3
4
5
data(ps_NP)
ps_NP %>%
  phyloseq::subset_samples(visit_name == "w1" & birth_mode == "vag") %>%
  create_bar() +
  ggplot2::coord_flip()

wsteenhu/microbiomer documentation built on March 11, 2021, 6:05 p.m.