phyloseq_ntaxa_by_tax: Count number of OTUs by taxonomic rank for each sample.

View source: R/phyloseq_ntaxa_by_tax.R

phyloseq_ntaxa_by_taxR Documentation

Count number of OTUs by taxonomic rank for each sample.

Description

Count number of OTUs by taxonomic rank for each sample.

Usage

phyloseq_ntaxa_by_tax(
  physeq,
  TaxRank = "Phylum",
  relative = F,
  add_meta_data = T
)

Arguments

physeq

A phyloseq-class object

TaxRank

Name of the taxonomic rank

relative

Logical, return relative number of OTUs

add_meta_data

Logical, add sample metadata to the resulting table

Details

This function will split phyloseq object by the specified taxonomic rank

Value

Data frame with OTU counts (columns: Sample, TaxRank, N.OTU + optional sample metadata).

Examples

data(GlobalPatterns)
phylum_counts <- phyloseq_ntaxa_by_tax(GlobalPatterns, TaxRank = "Phylum")
head(phylum_counts)


vmikk/metagMisc documentation built on June 20, 2024, 7:20 a.m.