plotLoadings {ChemoSpec} | R Documentation |
Plot PCA Loadings for a Spectra Object
Description
Creates a multi-panel plot of loadings along with a reference spectrum.
Usage
plotLoadings(spectra, pca, loads = c(1), ref = 1, ...)
Arguments
spectra |
An object of S3 class |
pca |
An object of class |
loads |
An integer vector giving the loadings to plot. More than 3 loadings creates a useless plot using the default graphics window. |
ref |
An integer specifying the reference spectrum to plot, which appears at the bottom of the plot. |
... |
Parameters to be passed to the plotting routines. Applies to base graphics only. |
Value
The returned value depends on the graphics option selected (see GraphicsOptions()
).
-
base
: None. Side effect is a plot. -
ggplot2
: The plot is displayed, and aggplot2
object is returned if the value is assigned. The plot can be modified in the usualggplot2
manner.
Author(s)
Bryan A. Hanson (DePauw University), Tejasvi Gupta.
See Also
c_pcaSpectra
for an example. See plot2Loadings
to plot two loadings against each
other, and sPlotSpectra
for an alternative approach.
Additional documentation at https://bryanhanson.github.io/ChemoSpec/