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

r_pcaSpectra

Robust PCA of a Spectra Object


Description

A wrapper which carries out robust PCA analysis on a Spectra object. The data are row- and column-centered, and the user can select various options for scaling.

Usage

r_pcaSpectra(spectra, choice = "noscale")

Arguments

spectra

An object of S3 class Spectra.

choice

A character vector describing the type of scaling to be carried out. One of c("noscale", "mad").

Value

An object of classes converted_from_princomp and prcomp. It includes a list element called $method, a character string describing the pre-processing carried out and the type of PCA performed (used to annotate plots).

Author(s)

Bryan A. Hanson, DePauw University.

References

K. Varmuza and P. Filzmoser Introduction to Multivariate Statistical Analysis in Chemometrics, CRC Press, 2009.

See Also

PCAgrid for the underlying function, c_pcaSpectra for classical PCA calculations, s_pcaSpectra for sparse PCA calculations, irlba_pcaSpectra for PCA via the IRLBA algorithm. Additional documentation at https://bryanhanson.github.io/ChemoSpec/

Examples

data(metMUD1)
pca <- r_pcaSpectra(metMUD1)
plotScree(pca)
plotScores(metMUD1, pca,
  main = "metMUD1 NMR Data",
  pcs = c(1, 2), ellipse = "cls", tol = 0.05
)
plotLoadings(metMUD1, pca,
  main = "metMUD1 NMR Data",
  loads = 1:2, ref = 1
)

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.