Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

addLR

Additive logratio coordinates


Description

The additive logratio coordinates map D-part compositional data from the simplex into a (D-1)-dimensional real space.

Usage

addLR(x, ivar = ncol(x), base = exp(1))

Arguments

x

D-part compositional data

ivar

Rationing part

base

a positive or complex number: the base with respect to which logarithms are computed. Defaults to exp(1).

Details

The compositional parts are divided by the rationing part before the logarithm is taken.

Value

A list of class “alr” which includes the following content:

x.alr

the resulting coordinates

varx

the rationing variable

ivar

the index of the rationing variable, indicating the column number of the rationing variable in the data matrix x

cnames

the column names of x

The additional information such as cnames or ivar is useful when an inverse mapping is applied on the ‘same’ data set.

Author(s)

Matthias Templ

References

Aitchison, J. (1986) The Statistical Analysis of Compositional Data Monographs on Statistics and Applied Probability. Chapman \& Hall Ltd., London (UK). 416p.

See Also

Examples

data(arcticLake)
x <- arcticLake
x.alr <- addLR(x, 2)
y <- addLRinv(x.alr)
## This exactly fulfills:
addLRinv(addLR(x, 3))
data(expenditures)
x <- expenditures
y <- addLRinv(addLR(x, 5))
head(x)
head(y)
## --> absolute values are preserved as well.

## preserve only the ratios:
addLRinv(x.alr, ivar=2, useClassInfo=FALSE)

robCompositions

Compositional Data Analysis

v2.3.0
GPL (>= 2)
Authors
Matthias Templ [aut, cre] (<https://orcid.org/0000-0002-8638-5276>), Karel Hron [aut] (<https://orcid.org/0000-0002-1847-6598>), Peter Filzmoser [aut] (<https://orcid.org/0000-0002-8014-4682>), Kamila Facevicova [ctb], Petra Kynclova [ctb], Jan Walach [ctb], Veronika Pintar [ctb], Jiajia Chen [ctb], Dominika Miksova [ctb], Bernhard Meindl [ctb], Alessandra Menafoglio [ctb] (<https://orcid.org/0000-0003-0682-6412>), Alessia Di Blasi [ctb], Federico Pavone [ctb], Gianluca Zeni [ctb]
Initial release
2020-11-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.