alr | R Documentation |
Compute the additive log ratio transform of a (dataset of) composition(s).
Default method is function
alr
from package compositions.
alr(x, ...)
## Default S3 method:
alr(x, ivar = ncol(x), ...)
## S3 method for class 'hyperSpec'
alr(x, ivar = ncol(x$spc), ...)
x |
A composition, not necessarily closed. (A numeric data frame or matrix.) |
... |
further parameters to |
ivar |
The number of column in |
Returns the transformed data matrix with one dimension less than
x
. Thus for hyperSpec
object the last value of
x$.wavelength is removed.
alr
Other row-wise transformations:
apt()
,
clr()
,
cpt()
,
ilr()
,
ipt()
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.