tax_prop: Proportion of Taxa In Community Data

View source: R/tax_prop.R

tax_propR Documentation

Proportion of Taxa In Community Data

Description

Calculates the proportion of taxonomic categories across samples of a community data object.

Usage

tax_prop(
  com,
  taxon,
  var = NULL,
  n = length(levels(com$tax[, taxon])),
  fun = sum,
  omit_unclassified = T,
  term = "unclassified"
)

Arguments

com

a community data object.

taxon

name of the taxonomic level to calculate proportions. Must be a column name in table 'tax'.

var

a factor to pool samples. Must be a column name in table 'env'. Optional.

fun

function to use for pooling taxonomic data. Default is sum.

omit_unclassified

omit unclassified taxa from the column sorting. Unclassified taxa are placed at the end.

term

if omit_unclassified = T, the term defining unclassified taxa.

Value

A data frame with proportions of taxa across samples.

Examples

tax_prop()

jgmv/comecol documentation built on June 6, 2023, 4:07 p.m.