Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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 class '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

Examples

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

mda

Mixture and Flexible Discriminant Analysis

v0.5-2
GPL-2
Authors
S original by Trevor Hastie & Robert Tibshirani. Original R port by Friedrich Leisch, Kurt Hornik and Brian D. Ripley. Balasubramanian Narasimhan has contributed to the upgrading of the code.
Initial release
2020-06-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.