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 aov_pcaSpectra
series of functions. Centering the data should always be done in PCA and it
is the default here.
1  c_pcaSpectra(spectra, choice = "noscale", cent = TRUE)

spectra 
An object of S3 class 
choice 
A character string indicating the choice of scaling. One of

cent 
Logical: whether or not to center the data. Always center the data unless you know it to be already centered. 
The scale choice autoscale
scales the columns by their standard
deviation. Pareto
scales by the square root of the standard
deviation.
An object of class prcomp
, modified to include a list
element called $method
, a character string describing the
preprocessing carried out and the type of PCA performed (it appears on
plots which you might make).
Bryan A. Hanson, DePauw University.
K. Varmuza and P. Filzmoser Introduction to Multivariate Statistical Analysis in Chemometrics, CRC Press, 2009.
https://github.com/bryanhanson/ChemoSpec
prcomp
for the underlying function,
r_pcaSpectra
for analogous robust PCA calculations.
For displaying the results, plotScree
,
plotScores
, plotLoadings
,
plot2Loadings
, sPlotSpectra
,
plotScores3D
, plotScoresRGL
.
1 2 3 4  data(metMUD1)
pca < c_pcaSpectra(metMUD1)
plotScores(metMUD1, pca, main = "metMUD1 NMR Data",
pcs = c(1,2), ellipse = "cls", tol = 0.05)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.