CLR: Centred logratio transformation

View source: R/toolbox.R

CLRR Documentation

Centred logratio transformation

Description

Calculates Aitchison's centered logratio transformation for a dataset of class compositional or a compositional data matrix.

Usage

CLR(x, ...)

## Default S3 method:
CLR(x, inverse = FALSE, ...)

## S3 method for class 'compositional'
CLR(x, ...)

Arguments

x

an object of class compositional OR a matrix of numerical values

...

optional arguments

inverse

perform the inverse inverse logratio transformation?

Value

a matrix of CLR coordinates OR an object of class compositional (if inverse=TRUE)

Examples

# The following code shows that applying provenance's PCA function
# to compositional data is equivalent to applying R's built-in
# princomp function to the CLR transformed data.
data(Namib)
plot(PCA(Namib$Major))
dev.new()
clrdat <- CLR(Namib$Major)
biplot(princomp(clrdat))

pvermees/provenance documentation built on Feb. 5, 2024, 4:50 a.m.