getCLR: getCLR

Description Usage Arguments Details Value Examples

Description

Obtain the centered log ratio transformation of compositional data.

Usage

1
getCLR(dat)

Arguments

dat

n x p matrix of numerical variables. For microbiome data, n: sample size, p: number of taxa

Details

A pseudocount is added to all taxa if zero values exist. A pseudocount of 0.01 is added if "dat" is read counts (rarefied or not), and a pseudocount that is 0.01 times the smallest nonzero relative abundances is added if "dat" is already proportions.

Value

n x p matrix of the log-ratio transformed data.

Examples

1
2
3
4
n = 10; p = 100
set.seed(1)
dat = matrix(rbinom(n*p, size = 1000,  0.005),n,p)
X = getCLR(dat)

zhaoni153/GHT documentation built on May 14, 2019, 10:37 p.m.