CLR: Centred logratio transformation

Description Usage Arguments Value Examples

View source: R/toolbox.R

Description

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

Usage

1
2
3
4
5
6
7
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

1
2
3
4
5
6
7
8
# 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))

Example output



provenance documentation built on May 5, 2021, 1:06 a.m.