combine_otu_tables: A function to combine otu tables

Description Usage Arguments Examples

Description

This function takes two or more otu tables as a list of matrices, and combines them. Must keep rows as samples and taxa as columns (or vice versa, must be consistent) Must provide a list of otu matrices as input (i.e., not a list of dataframes)

Usage

1

Arguments

otu_tabs

a list of otu matrices to be combined

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
otu_tab1 <- matrix(
c(2, 4, 3, 1, 5, 7),
nrow=3, ncol=2)
otu_tab2 <- matrix(
 c(3, 5, 1, 3, 5, 8),
 nrow=2, ncol=3)
rownames(otu_tab1) <- c("otu1","otu2","otu3")
colnames(otu_tab1) <- c("sample1","sample2")
rownames(otu_tab2) <- c("otu3","otu4")
colnames(otu_tab2) <- c("sample3","sample4","sample5")

otu_tabs <- list(otu_tab1, otu_tab2)
combine_otu_tables(otu_tabs)

cjschulz/micromixR documentation built on May 13, 2019, 7:32 p.m.