pcaMethods (version 1.64.0)

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

Description

A common way of visualizing two principal components

Usage

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.

Value

None, used for side effect.

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.

See Also

pca, biplot

Examples

Run this code
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]))

Run the code above in your browser using DataCamp Workspace