Learn R Programming

coda.base (version 1.0.3)

alr_basis: Additive log-ratio basis

Description

Compute the transformation matrix to express a composition using the oblique additive log-ratio coordinates.

Usage

alr_basis(dim, denominator = NULL, numerator = NULL)

Value

matrix

Arguments

dim

An integer indicating the number of components. If a dataframe or matrix is provided, the number of components is inferred from the number of columns. If a character vector specifying the names of the parts is provided the number of component is its length.

denominator

part used as denominator (default behaviour is to use last part)

numerator

parts to be used as numerator. By default all except the denominator parts are chosen following original order.

References

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

Examples

Run this code
alr_basis(5)
# Third part is used as denominator
alr_basis(5, 3)
# Third part is used as denominator, and
# other parts are rearranged
alr_basis(5, 3, c(1,5,2,4))

Run the code above in your browser using DataLab