plot.plsc: Plot Method for Class 'plsc' or 'plslda'

View source: R/mt_plsc.R

plot.plscR Documentation

Plot Method for Class 'plsc' or 'plslda'

Description

Plot latent components of plsc or plslda.

Usage

## S3 method for class 'plsc'
plot(x, dimen, ...)

## S3 method for class 'plslda'
plot(x, dimen, ...)

Arguments

x

An object of class plsc or plslda.

dimen

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.

Details

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.

Value

An object of class "trellis".

Author(s)

Wanchang Lin

See Also

plsc, predict.plsc,plslda, predict.plslda, pls_plot_wrap, panel.elli.1.

Examples

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")


mt documentation built on June 22, 2024, 12:24 p.m.

Related to plot.plsc in mt...