Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plotLoadings

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 Spectra.

pca

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 ChemoSpec functions c_pcaSpectra or r_pcaSpectra were used to create pca.

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.

...

Additional parameters to be passed to plotting functions.

Value

None. Side effect is a plot.

Author(s)

Bryan A. Hanson, DePauw University.

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/


ChemoSpec

Exploratory Chemometrics for Spectroscopy

v5.3.11
GPL-3
Authors
Bryan A. Hanson [aut, cre] (<https://orcid.org/0000-0003-3536-8246>), Mike Bostock [cph, ctb] (author of the d3.js library used by plotSpectraJS, http://d3js.org), Matt Keinsley [ctb] (author of initial AOV-PCA code)
Initial release
2021-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.