Learn R Programming

pls (version 1.1-0)

scoreplot: Plots of Scores, Loadings and Correlation Loadings

Description

Functions to make scatter plots of scores or correlation loadings, and scatter or line plots of loadings.

Usage

scoreplot(object, comps = 1:2, labels, identify = FALSE, type = "p",
          xlab, ylab, ...)
## S3 method for class 'scores':
plot(x, \dots)

loadingplot(object, comps = 1:2, scatter = FALSE, labels, identify = FALSE, type, lty, lwd = NULL, pch, cex = NULL, col, legendpos, xlab, ylab, ...) ## S3 method for class 'loadings': plot(x, \dots)

corrplot(object, comps = 1:2, labels, identify = FALSE, type = "p", xlab, ylab, ...)

Arguments

Value

  • The functions return whatever the underlying plot function (or identify) returns.

encoding

latin1

Details

plot.scores is simply a wrapper calling scoreplot, passing all arguments. Similarly for plot.loadings.

scoreplot makes one or more scatter plots of the scores, depending on how many components are selected. If one or two components are selected, and identify is TRUE, the function identify is used to interactively identify points.

If scatter is TRUE, loadingplot works exactly like scoreplot. Otherwise, it makes a lineplot of the selected loading vectors, and if identify is TRUE, uses identify to interactively identify points. Also, if legendpos is given, a legend is drawn at the position indicated.

corrplot works exactly like scoreplot, except that at least two components must be selected. The correlation loadings, i.e. the correlations between each variable and the selected components, are plotted as pairwise scatter plots, with two concentric circles of radius 0.5 and 1.

scoreplot, loadingplot and corrplot can also be called through the plot method for mvr objects, by specifying plottype as "scores", "loadings" or "correlation", respectively. See plot.mvr. scoreplot and loadingplot also work with princomp objects. (However, plot(scores(...)) and plot(loadings(...)) will not work.)

See Also

mvr, plot.mvr, scores, loadings, identify, legend

Examples

Run this code
data(NIR)
mod <- plsr(y ~ X, ncomp = 10, data = NIR)
## These three are equivalent:
scoreplot(mod, comps = 1:5)
plot(scores(mod), comps = 1:5)
plot(mod, plottype = "scores", comps = 1:5)

loadingplot(mod, comps = 1:5)
loadingplot(mod, comps = 1:5, legendpos = "topright") # With legend
loadingplot(mod, comps = 1:5, scatter = TRUE) # Plot as scatterplots

corrplot(mod, comps = 1:2)
corrplot(mod, comps = 1:3)

Run the code above in your browser using DataLab