1 2 3 4 5 6 7 8
| Dataset <- read.table("C:/Users/Pierre/Downloads/USArrests.csv", header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE)
Dataset.PCA<-Dataset[, c("Murder", "Assault", "UrbanPop", "Rape")]
res<-PCA(Dataset.PCA , scale.unit=TRUE, ncp=5, graph = FALSE)
plot.PCA(res, axes=c(1, 2), choix="ind", habillage="none", col.ind="black", col.ind.sup="blue", col.quali="magenta", label=c("ind", "ind.sup", "quali"),
new.plot=TRUE)
plot.PCA(res, axes=c(1, 2), choix="var", new.plot=TRUE, col.var="black", col.quanti.sup="blue", label=c("var", "quanti.sup"), lim.cos2.var=0)
summary(res, nb.dec = 3, nbelements=10, nbind = 10, ncp = 3, file="")
remove(Dataset.PCA) |
Partager