residuals.pcaRes {pcaMethods}R Documentation

Residuals values from a PCA model.

Description

This function extracts the residuals values from a pcaRes object for the PCA methods SVD, Nipals, PPCA and BPCA

Usage

residuals.pcaRes(object, data, nPcs=object@nPcs, ...)

Arguments

object pcaRes the pcaRes object of interest.
data matrix The data that was used to calculate the PCA model (or a different dataset to e.g. adress its proximity to the model).
nPcs numeric The amount of PC's to consider
... Not passed on anywhere, included for S3 consistency.

Value

A matrix with the residuals

Author(s)

Henning Redestig <redestig[at]psc.riken.jp>

Examples

data(iris)
pcIr <- pca(iris[,1:4])
head(residuals(pcIr, iris[,1:4]))

[Package pcaMethods version 1.22.0 Index]