# NOT RUN {
iris.p <- prcomp(iris[, 1:4], scale=TRUE)$x[, 1:2]
plot(iris.p, type="n", xlab="PC1", ylab="PC2")
pal <- rainbow(3)
text(iris.p, labels=abbreviate(iris[, 5], 1, method="both.sides"),
col=pal[as.numeric(iris[, 5])])
Hulls(iris.p[, 1:2], as.numeric(iris[, 5]), centers=TRUE, usecolors=pal)
# }
Run the code above in your browser using DataLab