Learn R Programming

OTUtable (version 1.1.2)

zscore: Z-score normalize relative abundance data

Description

Normalizes taxa abundances in a table of relative abundance data using the z-score method. ((Abundance of one OTU in one sample) - (mean abundance for that OTU ))/(standard deviation of that OTU)

Usage

zscore(table)

Arguments

table

A table of relative abundance data with taxa in rows and samples in columns

Value

Returns a table with relative abundance data replaced by z-scores

Examples

Run this code
# NOT RUN {
data(otu_table)

# Create a small table for z-score normalization
example <- year_subset("05", otu_table)
example <- bog_subset("TBE", example)

# Remove OTUs that are not present in this subset
example <- example[which(rowSums(example) > 0), ]

z_otu_table <- zscore(example)
# }

Run the code above in your browser using DataLab