data(Armada)
# delete character and redundant variable
armada <- Armada[,-c(1,6)]
# use fleet as labels
fleet <- Armada[, 1]
# do a PCA of the standardized data
armada.pca <- prcomp(armada, scale.=TRUE)
summary(armada.pca)
# screeplot
plot(armada.pca, type="lines", pch=16, cex=2)
biplot(armada.pca, xlabs = fleet,
xlab = "PC1 (Fleet size)",
ylab = "PC2 (Fleet configuration)")
Run the code above in your browser using DataLab