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

sPlotSpectra

s-Plot of Spectra Data (Post PCA)


Description

Produces a scatter plot of the correlation of the variables against their covariance for a chosen principal component. It allows visual identification of variables driving the separation and thus is a useful adjunct to traditional loading plots.

Usage

sPlotSpectra(spectra, pca, pc = 1, tol = 0.05, ...)

Arguments

spectra

An object of S3 class Spectra.

pca

The result of a pca calculation on Spectra (i.e. the output from c_pcaSpectra or r_pcaSpectra).

pc

An integer specifying the desired pc plot.

tol

A number describing the fraction of points to be labeled. tol = 1.0 labels all the points; tol = 0.05 labels the most extreme 5 percent.

...

Additional parameters to be passed to plotting functions.

Value

A data frame containing the frequency, covariance and correlation of the selected pc for the Spectra object. A plot of the correlation vs. covariance is created.

Author(s)

Matthew J. Keinsley and Bryan A. Hanson, DePauw University.

References

Wiklund, Johansson, Sjostrom, Mellerowicz, Edlund, Shockcor, Gottfries, Moritz, and Trygg. "Visualization of GC/TOF-MS-Based Metabololomics Data for Identification of Biochemically Interesting Compounds Usings OPLS Class Models" Analytical Chemistry Vol.80 no.1 pgs. 115-122 (2008).

See Also

Additional documentation at https://bryanhanson.github.io/ChemoSpec/

Examples

data(SrE.IR)
IR.pca <- c_pcaSpectra(SrE.IR)
myt <- expression(bolditalic(Serenoa) ~ bolditalic(repens) ~ bold(IR ~ Spectra))
splot <- sPlotSpectra(
  spectra = SrE.IR, pca = IR.pca, pc = 1, tol = 0.001,
  main = myt
)

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.