Learn R Programming

mda (version 0.5-4)

plot.fda: Plot for Flexible Discriminant Analysis

Description

Plot in discriminant (canonical) coordinates a fda or (by inheritance) a mda object.

Usage

# S3 method for fda
plot(x, data, coords, group, colors, pch, mcolors, mpch, pcex, mcex, ...)

Arguments

x

an object of class "fda".

data

the data to plot in the discriminant coordinates. If group="true", then data should be a data frame with the same variables that were used in the fit. If group="predicted", data need not contain the response variable, and can in fact be the correctly-sized "x" matrix.

coords

vector of coordinates to plot, with default coords="c(1,2)". All pairs of plots are produced.

group

if group="true" (the default), each point is color and symbol coded according to the response in data. If group="predicted", the class of each point is predicted from the model, and used instead.

colors

a vector of colors to be used in the plotting.

pch

a vector of plotting characters.

mcolors

a vector of colors for the class centroids; default is colors.

mpch

a vector of plotting characters for the centroids.

pcex

character expansion factor for the points; defualt is pcex="0.5".

mcex

character expansion factor for the centroids; defualt is pcex="2.5".

...

further arguments to be passed to or from methods.

See Also

fda, mda, predict.fda

Examples

Run this code
data(iris)
irisfit <- fda(Species ~ ., data = iris)
plot(irisfit)
data(ESL.mixture)
## Not a data frame
mixture.train=ESL.mixture[c("x","y")] 
mixfit=mda(y~x, data=mixture.train)
plot(mixfit, mixture.train)
plot(mixfit, data=ESL.mixture$xnew, group="pred")

Run the code above in your browser using DataLab