alr: [!] Additive logratio transformation

View source: R/alr.R

alrR Documentation

[!] Additive logratio transformation

Description

Compute the additive log ratio transform of a (dataset of) composition(s). Default method is function alr from package compositions.

Usage

alr(x, ...)

## Default S3 method:
alr(x, ivar = ncol(x), ...)

## S3 method for class 'hyperSpec'
alr(x, ivar = ncol(x$spc), ...)

Arguments

x

A composition, not necessarily closed. (A numeric data frame or matrix.)

...

further parameters to alr.

ivar

The number of column in x to be used as denominator variable. By default the last column is taken.

Value

Returns the transformed data matrix with one dimension less than x. Thus for hyperSpec object the last value of x$.wavelength is removed.

See Also

alr

Other row-wise transformations: apt(), clr(), cpt(), ilr(), ipt()

Examples

data(Spectra2)
Spectra <- Spectra2[,,300~600]
alr(Spectra)

ind <- wl2i(Spectra, 550) # number of column at 550 nm.
alr(Spectra, ind)

plot(Spectra)
plot(alr(Spectra))
plot(alr(Spectra, ind))


GegznaV/spHelper documentation built on April 16, 2023, 1:42 p.m.