agg_otus: Aggregate OTU data by another taxonomic level.

Description Usage Arguments Value Examples

View source: R/agg_otus.R

Description

Aggregate OTU data by another taxonomic level.

Usage

1
2
3
4
5
6
agg_otus(
  df = otu_df,
  sample_col = NULL,
  tax_df = otu_good_taxonomy,
  taxon = "Phylum"
)

Arguments

df

A dataframe containing OTU data, presumed to be normalized, although it could be done for raw count data as well. Defaults to otu_df.

sample_col

An optional vector, specifying the column in df which contains Sample names. If none is provided and a Sample_name column does not exist, rownames will be used.

tax_df

Taxonomy table. agg_otus() assumes that a column called OTU exists in tax_df. Defaults to otu_good_taxonomy.

taxon

String which describes the taxonomic level to aggregate by. Default is "Phylum".

Value

An aggregated tibble containing a column of Sample names and columns named according to the levels in taxon.

Examples

1
phy_df <- agg_otus(otu_df, "Phylum")

cb-42/cbmbtools documentation built on Jan. 9, 2021, 1:38 a.m.