# NOT RUN {
## use iris dataset
data(iris)
set.seed(100)
subid = sample(1:150,50)
X = as.matrix(iris[subid,1:4])
lab = as.factor(iris[subid,5])
## perform onto 2-dimensional space
output = do.lda(X, lab, ndim=2)
## visualize
opar <- par(no.readonly=TRUE)
plot(output$Y, col=lab, pch=19, main="3 groups on 2d plane")
par(opar)
# }
Run the code above in your browser using DataLab