rediduals-methods: Residuals values from a PCA model.

Description Usage Arguments Value Author(s) Examples

Description

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

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'pcaRes'
residuals(object, data = completeObs(object), ...)

## S4 method for signature 'pcaRes'
residuals(object, data = completeObs(object), ...)

## S4 method for signature 'pcaRes'
resid(object, data = completeObs(object), ...)

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).

...

Passed on to predict.pcaRes. E.g. setting the number of used components.

Value

A matrix with the residuals

Author(s)

Henning Redestig

Examples

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

Example output

Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, basename, cbind, colMeans, colSums, colnames,
    dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
    intersect, is.unsorted, lapply, lengths, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind,
    rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which, which.max, which.min

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.


Attaching package: 'pcaMethods'

The following object is masked from 'package:stats':

    loadings

  Sepal.Length  Sepal.Width Petal.Length  Petal.Width
1  0.016961033 -0.017413931 -0.003213722 -0.013531688
2  0.153738098 -0.157499944 -0.063561770 -0.040245920
3 -0.004118712  0.004318402 -0.008216967  0.024819848
4 -0.042211700  0.043033026  0.038670186 -0.039732177
5 -0.071755108  0.073445141  0.036261549  0.003000088
6 -0.105810493  0.108591772  0.024471838  0.073830412

pcaMethods documentation built on Nov. 8, 2020, 6:19 p.m.