alr.Rd
Compute the additive log ratio transform of a (dataset of) composition(s).
Default method is function
alr
from package compositions.
A composition, not necessarily closed. (A numeric data frame or matrix.)
further parameters to alr
.
The number of column in x
to be used as denominator variable.
By default the last column is taken.
Returns the transformed data matrix with one dimension less than
x
. Thus for hyperSpec
object the last value of
x$.wavelength is removed.
data(Spectra2)
Spectra <- Spectra2[,,300~600]
alr(Spectra)
#> hyperSpec object
#> 150 spectra
#> 3 data columns
#> 300 data points / spectrum
ind <- wl2i(Spectra, 550) # number of column at 550 nm.
alr(Spectra, ind)
#> hyperSpec object
#> 150 spectra
#> 3 data columns
#> 300 data points / spectrum
plot(Spectra)
plot(alr(Spectra))
plot(alr(Spectra, ind))