Learn R Programming

ebimetagenomics (version 0.6)

mergeOtu: Merges two OTU count data data frames to produce a combined OTU count data data frame

Description

This function merges two or more OTU count data data frames, such as returned by getRunOtu. The merged OTU data is returned as a data frame. The ordering of the two data frames to be merged should not be significant. The operation of merging should also be associative.

Usage

mergeOtu(...)

Arguments

...

A sequence of OTU data frames to be merged.

Value

An R data frame containing OTU count data. The first column is the OTU ID, the second is the count, and the third contains a taxonomic classification.

See Also

getSampleOtu, getRunOtu, projectRuns

Examples

Run this code
# NOT RUN {
ps=getProjectSummary("SRP047083")
samp=projectSamples(ps)
runs=runsBySample(ps,samp[2])

# merge two:
otu1=getRunOtu(runs[1])
otu2=getRunOtu(runs[2])
mergeOtu(otu1,otu2)

# merge many:
otuList=lapply(as.list(runs[1:5]),function(rid){getRunOtu(rid)})
Reduce(mergeOtu,otuList)
# }

Run the code above in your browser using DataLab