Principal Component Analysis
prcomp2.Rd
Performs a principal components analysis on the given data matrix
and returns the results as a prcomp
class object. This
function is "borrowed" from stats::prcomp()
, except
with some extra returned components of the SVD
that are not
returned by the standard function as well as hard coding
the projection to be returned and some simple data checks.
Arguments
- x
a numeric or complex matrix (or data frame) which provides the data for the principal components analysis.
- tol
a value indicating the magnitude below which components should be omitted. (Components are omitted if their standard deviations are less than or equal to
tol
times the standard deviation of the first component.) With the default null setting, no components are omitted (unlessrank.
is specified less thanmin(dim(x))
.). Other settings fortol
could betol = 0
ortol = sqrt(.Machine$double.eps)
, which would omit essentially constant components.
Note
We've simply hijacked prcomp()
and added elements to the return value.