## Not run:
# # load bordeaux wines dataset
# data(bordeaux)
#
# # descriptive discriminant analysis with within covariance matrix
# my_dda1 = desDA(bordeaux[,2:5], bordeaux$quality)
# my_dda1
#
# # descriptive discriminant analysis with total covariance matrix
# my_dda2 = desDA(bordeaux[,2:5], bordeaux$quality, covar="total")
# my_dda2
#
# # plot factor coordinates with ggplot
# library(ggplot2)
# bordeaux$f1 = my_dda1$scores[,1]
# bordeaux$f2 = my_dda1$scores[,2]
# ggplot(data=bordeaux, aes(x=f1, y=f2, colour=quality)) +
# geom_hline(yintercept=0, colour="gray70") +
# geom_vline(xintercept=0, colour="gray70") +
# geom_text(aes(label=year), size=4) +
# opts(title="Discriminant Map - Bordeaux Wines (years)")
# ## End(Not run)
Run the code above in your browser using DataLab