Plot latent components of plsc
or plslda
.
# S3 method for plsc
plot(x, dimen, ...)# S3 method for plslda
plot(x, dimen, ...)
An object of class "trellis"
.
An object of class plsc
or plslda
.
The index of latent components to be used for the plot.
Further arguments. See corresponding entry in
xyplot
for non-trivial details. One argument is
ep
: an integer for plotting ellipse. 1
and 2
for
plotting overall and group ellipse, respectively. Otherwise, none.
For details, see panel.elli.1
.
Wanchang Lin
Two functions are methods for the generic function plot()
of
class plsc
and plslda
.
If the length of dimen
is greater than 2, a pairs plot is used.
If the length of dimen
is equal to 2, a scatter plot is drawn.
Otherwise, the dot plot is drawn for the single component.
plsc
, predict.plsc
,plslda
,
predict.plslda
, pls_plot_wrap
,
panel.elli.1
.
data(abr1)
cl <- factor(abr1$fact$class)
dat <- abr1$pos
mod.plsc <- plsc(dat,cl,ncomp=4)
mod.plslda <- plslda(dat,cl,ncomp=4)
## Second component versus first
plot(mod.plsc,dimen=c(1,2),main = "Training data", ep = 2)
plot(mod.plslda,dimen=c(1,2),main = "Training data", ep = 2)
## Pairwise scatterplots of several components
plot(mod.plsc, main = "Training data", ep = 1)
plot(mod.plslda, main = "Training data", ep = 1)
## single component
plot(mod.plsc,dimen=c(1),main = "Training data")
plot(mod.plslda,dimen=c(1),main = "Training data")
Run the code above in your browser using DataLab