library(car)
# install.packages('rattle')
data(wine, package='rattle')
attach(wine)
head(wine)
scatterplotMatrix(wine[2:6])
library(MASS)
wine.lda <- lda(Type ~ ., data=wine)
wine.lda
wine.lda.values <- predict(wine.lda)
ldahist(data = wine.lda.values$x[,1], g=Type)
ldahist(data = wine.lda.values$x[,2], g=Type)
plot(wine.lda.values$x[,1],wine.lda.values$x[,2]) # make a scatterplot
text(wine.lda.values$x[,1],wine.lda.values$x[,2],Type,cex=0.7,pos=4,col="red") # add labels