Exploration of Multivariate Data
Submitted by dylan on Wed, 2009-01-21 06:38.
library(gclus)
library(car)
library(MASS)
library(cluster)
library(lattice)
library(TeachingDemos)
data(wine)
# chernoff faces
faces(aggregate(wine, list(wine$Class), FUN=mean)[,-c(1,2)], ncol=3, nrow=1)
# LDA on wine data
l <- lda(Class ~ . , data=wine)
plot(l, col=wine$Class)
## Some soils data from the car package
# LDA: all horizons
l <- lda(Contour ~ pH + N + Dens + P + Ca + Ca + Mg + K + Na, data=Soils)
plot(l, col=as.numeric(Soils$Contour))
# just the top horizon
l <- lda(Contour ~ pH + N + Dens + P + Ca + Ca + Mg + K + Na, data=Soils, subset=Depth=='0-10')
plot(l, col=as.numeric(Soils$Contour[Soils$Depth == '0-10']))
|