pls (version 1.0-1)

scoreplot: Plots of Scores and Loadings

Description

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

Usage

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

loadingplot(object, comps = 1:2, scatter = FALSE, labels, identify = FALSE, type, ...) ## S3 method for class 'loadings': plot(x, \dots)

Arguments

Value

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

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.

scoreplot and loadingplot can also be called through the plot method for mvr objects, by specifying plottype as "scores" or "loadings". 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

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(mvr, plottype = "scores", comps = 1:5)

loadingplot(mod, comps = 1:5)
loadingplot(mod, comps = 1:5, scatter = TRUE) # Plot as scatterplots

Run the code above in your browser using DataLab