Learn R Programming

OTUbase (version 1.22.0)

abundance: abundance

Description

abundance generates an abundance table. This table can be either weighted or unweighted.

Usage

abundance(object, ...)

Arguments

object
An OTUset or a TAXset object
...
Additional arguments. These will depend on if the object is an OTUset or a TAXset object.

Value

The returned value will be a data.frame.

Details

These are other arguments passed to abundance
  • taxCol If generating the abundance from a TAXset object, taxCol selects the column of the tax dataframe from which to calculate the abundance.
  • assignmentCol If generating the abundance from an OTUset object assignmentCol will select a column of the assignmentData dataframe to use when calculating abundance. This will override the default of creating an abundance table of the OTUs and instead create an abundance table of a column in the assignmentData dataframe.
  • sampleCol sampleCol generates the abundance table using a column in the sampleData data fram instead of the default of using the sampleID.
  • collab An optional parameter that selets a column of the sampleData dataframe to use when labeling the columns of the abundance table.
  • weighted By default this is FALSE. When set to TRUE abundance will return proportional abundances.

Examples

Run this code

## locate directory with data
dirPath <- system.file("extdata/Sogin_2006", package="OTUbase")

## read in data into OTUset object
soginOTU <- readOTUset(dirPath=dirPath, level="0.03", samplefile="sogin.groups", fastafile="sogin.fasta", otufile="sogin.unique.filter.fn.list", sampleADF="sample_metadata.txt")

## calculate abundance
abundance(soginOTU, collab="Site")

Run the code above in your browser using DataLab