Description Usage Arguments Details Value Author(s) See Also Examples
Decomposition of the spectra matrix is a common procedure in chemometric data
analysis. scores
and loadings
convert the result matrices into new hyperSpec
objects.
1 2 |
object |
A |
x |
matrix with the new content for Its size must correspond to rows (for |
wavelength |
for a scores-like |
label.wavelength |
The new label for the wavelength axis (if |
label.spc |
The new label for the spectra matrix |
scores |
is |
retain.columns |
for loading-like decompostition (i.e. Columns with different values across the rows will be set to |
... |
ignored. |
Multivariate data are frequently decomposed by methods like principal component analysis, partial least squares, linear discriminant analysis, and the like. These methods yield latent spectra (or latent variables, loadings, components, ...) that are linear combination coefficients along the wavelength axis and scores for each spectrum and loading.
The loadings matrix gives a coordinate transformation, and the scores are values in that new coordinate system.
The obtained latent variables are spectra-like objects: a latent variable has a coefficient for
each wavelength. If such a matrix (with the same number of columns as object
has
wavelengths) is given to decomposition
(also setting scores = FALSE
), the spectra
matrix is replaced by x
. Moreover, all columns of object@data
that did not contain
the same value for all spectra are set to NA
. Thus, for the resulting hyperSpec
object, plotspc
and related functions are meaningful.
plotmap
cannot be applied as the loadings are not laterally resolved.
The scores matrix needs to have the same number of rows as object
has spectra. If such a
matrix is given, decomposition
will replace the spectra matrix is replaced by x
and
object@wavelength
by wavelength
. The information related to each of the spectra is
retained. For such a hyperSpec
object, plotmap
and plotc
and
the like can be applied. It is also possible to use the spectra plotting, but the
interpretation is not that of the spectrum any longer.
A hyperSpec
object, updated according to x
C. Beleites
See %*%
for matrix multiplication of hyperSpec
objects.
See e.g. prcomp
and princomp
for principal component
analysis, and package pls
for Partial Least Squares Regression.
1 2 3 4 5 6 7 8 9 |
Loading required package: lattice
Loading required package: grid
Loading required package: ggplot2
Package hyperSpec, version 0.98-20161118
To get started, try
vignette ("introduction", package = "hyperSpec")
package?hyperSpec
vignette (package = "hyperSpec")
If you use this package please cite it appropriately.
citation("hyperSpec")
will give you the correct reference.
The project homepage is http://hyperspec.r-forge.r-project.org
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.