data(centaurea)
centaurea = naMeanSubst(centaurea)
centaurea = removePopulation(centaurea, populationName = c("LIP", "PREL"))
pcaRes = pca.calc(centaurea)
plotPoints(pcaRes, col = c(rgb(255, 0, 0, max = 255, alpha = 150), # red
rgb(0, 255, 0, max = 255, alpha = 150), # green
rgb(0, 0, 255, max = 255, alpha = 150), # blue
rgb(0, 0, 0, max = 255, alpha = 150)), # black
legend = FALSE, xlim = c(-5, 7.5), ylim = c(-5, 5.5))
plotAddLegend(pcaRes, col = c("red", "green", "blue", "black"), ncol = 2)
plotAddEllipses(pcaRes, col = c("red", "green", "blue", "black"), lwd = 3)
Run the code above in your browser using DataLab