Learn R Programming

ChemoSpec (version 2.0-2)

pcaDiag: Outlier Diagnostic Plots for PCA of a Spectra Object

Description

A function to carry diagnostics on the PCA results for a "Spectra" object. Basically a wrapper to Filzmoser's pcaDiagplot which colors everything according to the scheme stored in the "Spectra" object. Works with PCA results of either class "prcomp" or class "princomp". Works with either classical or robust PCA results.

Usage

pcaDiag(spectra, pca, pcs = 3, quantile = 0.975,
	plot = c("OD", "SD"), use.sym = FALSE, ...)

Arguments

Value

A list is returned as described in pcaDiagplot, so the result must be assigned or it will appear at the console. Side effect is a plot.

Rdversion

1.1

Details

If both plots are desired, the output should be directed to a file rather than the screen. Otherwise, the 2nd plot overwrites the 1st in the active graphics window. Alternatively, just call the function twice, once specifying OD and once specifying SD.

References

http://academic.depauw.edu/~hanson/ChemoSpec/ChemoSpec.html K. Varmuza and P. Filzmoser Introduction to Multivariate Statistical Analysis in Chemometrics, CRC Press, 2009.

See Also

pcaDiagplot in package chemometrics for the underlying function.

Examples

Run this code
data(SrE.IR)
results <- classPCA(SrE.IR, choice = "noscale")
temp <- pcaDiag(SrE.IR, results, pcs = 2, plot = "OD")
temp <- pcaDiag(SrE.IR, results, pcs = 2, plot = "SD")

Run the code above in your browser using DataLab