plot.kda {ks} | R Documentation |
Plot for kernel discriminant analysis for 1- to 3-dimensional data.
## S3 method for class 'kda' plot(x, y, y.group, ...)
x |
object of class |
y |
matrix of test data points |
y.group |
vector of group labels for test data points |
... |
other graphics parameters:
and those used in |
For kda
objects, the function headers for the different dimensional data are
## univariate plot(x, y, y.group, prior.prob=NULL, xlim, ylim, xlab="x", ylab="Weighted density function", drawpoints=FALSE, col, partcol, ptcol, lty, jitter=TRUE, rugsize, ...) ## bivariate plot(x, y, y.group, prior.prob=NULL, cont=c(25,50,75), abs.cont, approx.cont=FALSE, xlim, ylim, xlab, ylab, drawpoints=FALSE, drawlabels=TRUE, col, partcol, ptcol, ...) ## trivariate plot(x, y, y.group, prior.prob=NULL, cont=c(25,50,75), abs.cont, approx.cont=FALSE, colors, alphavec, xlab, ylab, zlab, drawpoints=FALSE, size=3, ptcol="blue", ...)
Plots for 1-d and 2-d are sent to graphics window. Plot for 3-d is sent to RGL window.
library(MASS) data(iris) ## univariate example ir <- iris[,1] ir.gr <- iris[,5] kda.fhat <- kda(x=ir, x.group=ir.gr, xmin=3, xmax=9) plot(kda.fhat, xlab="Sepal length") ## bivariate example ir <- iris[,1:2] ir.gr <- iris[,5] kda.fhat <- kda(x=ir, x.group=ir.gr) plot(kda.fhat) ## trivariate example ir <- iris[,1:3] ir.gr <- iris[,5] H <- Hkda(x=ir, x.group=ir.gr, bw="plugin", pilot="dscalar") kda.fhat <- kda(x=ir, x.group=ir.gr, Hs=H) plot(kda.fhat, asp=c(2,4,1)) ## colour indicates species, transparency indicates density heights