slplot-pcaRes-method: Side by side scores and loadings plot

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

A common way of visualizing two principal components

Usage

1
2
slplot(object, pcs=c(1,2), scoresLoadings=c(TRUE, TRUE),
sl="def", ll="def", hotelling=0.95, rug=TRUE, sub=NULL,...)

Arguments

object

a pcaRes object

pcs

which two pcs to plot

scoresLoadings

Which should be shown scores and or loadings

sl

labels to plot in the scores plot

ll

labels to plot in the loadings plot

hotelling

confidence interval for ellipse in the score plot

rug

logical, rug x axis in score plot or not

sub

Subtitle, defaults to annotate with amount of explained variance.

...

Further arguments to plot functions. Prefix arguments to par() with 's' for the scores plot and 'l' for the loadings plot. I.e. cex become scex for setting character expansion in the score plot and lcex for the loadings plot.

Details

This method is meant to be used as a quick way to visualize results, if you want a more specific plot you probably want to get the scores, loadings with scores(object), loadings(object) and then design your own plotting method.

Value

None, used for side effect.

Note

Uses layout instead of par to provide side-by-side so it works with Sweave (but can not be combined with par(mfrow=..))

Author(s)

Henning Redestig

See Also

pca, biplot

Examples

1
2
3
4
data(iris)
pcIr <- pca(iris[,1:4], scale="uv")
slplot(pcIr, sl=NULL, spch=5)
slplot(pcIr, sl=NULL, lcex=1.3, scol=as.integer(iris[,5]))

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, cbind, colMeans, colSums, colnames, 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

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