View source: R/normalization.R
clr | R Documentation |
The centered log-ratio transformation for compositional data (not necessarily closed/normalized!)
clr(x, ...) ## Default S3 method: clr(x, base = exp(1), tol = .Machine$double.eps) ## S3 method for class 'matrix' clr(x, mar = 2, base = exp(1), tol = .Machine$double.eps) ## S3 method for class 'data.frame' clr(x, mar = 2, ...)
x |
a numeric data vector containing components of a composition |
... |
additional arguments |
base |
base of log to use, default is natural log |
tol |
machine tolerance for a zero count, default is machine tol (.Machine$double.eps) |
The clr is computed as
x[i]
= log (x[i]
/ exp(mean(log(x)))
)
clr transformed x
# vector examples: clr(norm_to_total(1:10)) clr(1:10) # matrix examples: dmat <- matrix(exp(rnorm(110)), 10) clr(dmat, 1) clr(dmat, 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.