Learn R Programming

provenance (version 4.4)

CLR: Centred logratio transformation

Description

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

Usage

CLR(x, ...)

# S3 method for default CLR(x, inverse = FALSE, ...)

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

Value

a matrix of CLR coordinates OR an object of class

compositional (if inverse=TRUE)

Arguments

x

an object of class compositional OR a matrix of numerical values

...

optional arguments

inverse

perform the inverse inverse logratio transformation?

Examples

Run this code
# 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))

Run the code above in your browser using DataLab