Learn R Programming

ChemoSpec (version 2.0-2)

classPCA: Classical PCA of Spectra Objects

Description

A wrapper which carries out classical PCA analysis on a "Spectra" object. The user can select various options for scaling. There is no normalization by rows - do this manually using normSpectra. There is an option to control centering, but this is mainly for compatibility with the aovPCA series of functions. Centering the data should always be done in PCA and it is the default here.

Usage

classPCA(spectra, choice = "noscale", cent = TRUE)

Arguments

Value

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 plots which you might make).

Rdversion

1.1

Details

The scale choice autoscale scales the columns by their standard deviation. Pareto scales by the square root of the standard deviation.

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

prcomp for the underlying function, robPCA for analogous robust PCA calculations. For displaying the results, plotScree, plotScores, plotLoadings, plot2Loadings.

Examples

Run this code
data(SrE.IR)
results <- classPCA(SrE.IR, choice = "noscale")
myt <- expression(bolditalic(Serenoa)~bolditalic(repens)~bold(IR~Spectra))
plotScores(SrE.IR, main = myt, results, pcs = c(1,2),
	ellipse = "rob", tol = 0.05)

Run the code above in your browser using DataLab