Learn R Programming

mt (version 2.0-1.20)

plot.pcalda: Plot Method for Class 'pcalda'

Description

Plot linear discriminants of pcalda.

Usage

# S3 method for pcalda
plot(x, dimen, ...)

Value

An object of class "trellis".

Arguments

x

An object of class pcalda.

dimen

The index of linear discriminants 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.

Author

Wanchang Lin

Details

This function is a method for the generic function plot() for class pcalda. 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.

See Also

pcalda, predict.pcalda, lda_plot_wrap,panel.elli.1.

Examples

Run this code
data(abr1)
cl   <- factor(abr1$fact$class)
dat  <- abr1$pos

model <- pcalda(dat,cl)

## Second component versus first
plot(model,dimen=c(1,2),main = "Training data",ep=2)
## Pairwise scatterplots of several components 
plot(model,main = "Training data",ep=1)

## The first component
plot(model,dimen=c(1),main = "Training data")

Run the code above in your browser using DataLab