Creates a multi-panel plot of loadings along with a reference spectrum.
plotLoadings(spectra, pca, loads = c(1), ref = 1, ...)
An object of S3 class
An object of class
prcomp, modified to include a
list element called
$method, a character string describing the
pre-processing carried out and the type of PCA performed (it appears on the
plot). This is automatically provided if
r_pcaSpectra were used to create
An integer vector giving the loadings to plot. More than 3 loadings creates a useless plot using the default graphics window.
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.
The returned value depends on the graphics option selected (see
None. Side effect is a plot.
The plot is displayed, and a
ggplot2 plot object is returned if the
value is assigned. The plot can be modified in the usual
c_pcaSpectra for an example. See
to plot two loadings against each
sPlotSpectra for an alternative approach.
Additional documentation at https://bryanhanson.github.io/ChemoSpec/