PcaClassic: Principal Components Analysis

Description Usage Arguments Value Note Author(s) References See Also

View source: R/PcaClassic.R


Performs a principal components analysis and returns the results as an object of class PcaClassic (aka constructor).


PcaClassic(x, ...)
## Default S3 method:
PcaClassic(x, k = ncol(x), kmax = ncol(x), 
    scale=FALSE, signflip=TRUE, crit.pca.distances = 0.975, trace=FALSE, ...)
## S3 method for class 'formula'
PcaClassic(formula, data = NULL, subset, na.action, ...)



a formula with no response variable, referring only to numeric variables.


an optional data frame (or similar: see model.frame) containing the variables in the formula formula.


an optional vector used to select rows (observations) of the data matrix x.


a function which indicates what should happen when the data contain NAs. The default is set by the na.action setting of options, and is na.fail if that is unset. The default is na.omit.


arguments passed to or from other methods.


a numeric matrix (or data frame) which provides the data for the principal components analysis.


number of principal components to compute. If k is missing, or k = 0, the algorithm itself will determine the number of components by finding such k that l_k/l_1 >= 10.E-3 and Σ_{j=1}^k l_j/Σ_{j=1}^r l_j >= 0.8. It is preferable to investigate the scree plot in order to choose the number of components and then run again. Default is k=ncol(x).


maximal number of principal components to compute. Default is kmax=10. If k is provided, kmax does not need to be specified, unless k is larger than 10.


a value indicating whether and how the variables should be scaled to have unit variance (only possible if there are no constant variables). If scale=FALSE (default) or scale=NULL no scaling is performed (a vector of 1s is returned in the scale slot). If scale=TRUE the data are scaled to have unit variance. Alternatively it can be a function like sd or Qn or a vector of length equal the number of columns of x. The value is passed to the underlying function and the result returned is stored in the scale slot. Default is scale=FALSE.


a logical value indicating wheather to try to solve the sign indeterminancy of the loadings - ad hoc approach setting the maximum element in a singular vector to be positive. Default is signflip = FALSE


criterion to use for computing the cutoff values for the orthogonal and score distances. Default is 0.975.


whether to print intermediate results. Default is trace = FALSE


An S4 object of class PcaClassic-class which is a subclass of the virtual class Pca-class.


This function can be seen as a wrapper arround prcomp() from stats which returns the results of the PCA in a class compatible with the object model for robust PCA.


Valentin Todorov [email protected]


Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. Journal of Statistical Software, 32(3), 1–47. URL http://www.jstatsoft.org/v32/i03/.

See Also

Pca-class, PcaClassic-class,

rrcov documentation built on May 30, 2017, 3:23 a.m.