scoreplot(object, ...)
## S3 method for class 'default':
scoreplot(object, comps = 1:2, labels, identify = FALSE, type = "p",
xlab, ylab, \dots)
## S3 method for class 'scores':
plot(x, \dots)loadingplot(object, ...)
## S3 method for class 'default':
loadingplot(object, comps = 1:2, scatter = FALSE, labels,
identify = FALSE, type, lty, lwd = NULL, pch, cex = NULL,
col, legendpos, xlab, ylab, \dots)
## S3 method for class 'loadings':
plot(x, \dots)
corrplot(object, comps = 1:2, labels, radii = c(sqrt(1/2), 1),
identify = FALSE, type = "p", xlab, ylab, ...)
scatter = FALSE
in loadingplot
, they are used to
label the $x$ axis tick marks. Either a vector (of length > 1)
of labels, or one of "names"
and <corrplot
. The default radii represent 50% and 100%
explained variance of the $X$ variables by the chosen components.identify
to
interactively identify points. See below."p"
(points) for scatter plots and "l"
(lines) for
line plots. See plot
for a complete list
of types (not all types arpar
for the details).points
for all alternatives.par
for the details.scatter
is
TRUE
. If present, a legend is drawn at the given position.
The position can be specified symbolically (e.g., legendpos =
"topright"
). This requires Rtitle
for details.scores
or loadings
object. The scores or
loadings to plot.identify
) returns.plot.scores
is simply a wrapper calling scoreplot
,
passing all arguments. Similarly for plot.loadings
. scoreplot
is generic, currently with a default method that
works for matrices and any object for which scores
returns a matrix. The default scoreplot
method
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.
Also loadingplot
is generic, with a default method that works
for matrices and any object where loadings
returns a
matrix. If scatter
is TRUE
, the default method works exactly
like the default scoreplot
method. 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 the default scoreplot
method, except that at least two components must be selected. The
radii
. Each
point corresponds to an $X$ variable. The squared distance
between the point and origo equals the fraction of the variance of the
variable explained by the components in the panel. The default
radii
corresponds to 50% and 100% explained variance.
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
.
mvr
, plot.mvr
,
scores
, loadings
, identify
,
legend
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