predict.prcomp
Principal Component Scores

Description

Calculates a matrix of the scores for the principal components.

Usage

predict.prcomp(object, newdata, ... )

Arguments

object an object of class prcomp.
newdata a matrix or data frame of numeric data. The column names must include the variables used to compute object.

Details

This is the prcomp method for the generic function predict.
Value
returns a matrix of principal component scores.
See Also
prcomp, predict.
Examples
wafer.pc <- prcomp(~ pre.mean + post.mean + pre.dev + post.dev,
    data=Sdatasets::wafer)
hyp.data <- data.frame(pre.mean=c(2,3), post.mean=c(2,3),
    post.dev=c(.2,.3), pre.dev=c(.1,.2))
predict(wafer.pc, hyp.data)
Package stats version 6.1.1-7
Package Index