knitr::opts_chunk$set(echo = TRUE)
autos <- read.table("autos.csv", sep=";",header=TRUE)
rownames(autos)<-autos$Modele
autos$Modele<-NULL
autos<-autos[,c(1:6,8)]
library(FactoMineR)
help(PCA)
res.autos<-PCA(autos, scale.unit=TRUE, quanti.sup = c("PRIX") )
summary(res.autos, nb.dec=2, nb.elements =Inf, nbind = Inf, ncp=3) #les résultats avec deux décimales, pour tous les individus, toutes les variables, sur les 3 premières CP
eigenvalues <- res.autos$eig  # pour faire l'eboulis des valeurs propres
bplt <- barplot(eigenvalues[, 2], names.arg=1:nrow(eigenvalues),
main = "Eboulis des valeurs propres",
xlab = "Principal Components",
ylab = "Percentage of variances",
col ="steelblue",
)
lines(x = bplt, eigenvalues[, 2], type="b", pch=19, col = "red")
alim <- read.table('alimentation.csv', sep=';', header=TRUE)
rownames(alim)<-alim$ROW_LABEL
alim$ROW_LABEL<-NULL
corr <- cor(alim)
corr <- cor(alim)
corr
res.alim<-PCA(alim, scale.unit=TRUE, quanti.sup = c())
summary(res.alim, nb.dec = 2, nbelements = Inf, nbind = Inf, ncp = 3)
help(cor)
corr <- cor(alim)
corr
data(iris)
head(iris)
View(iris)
corr.iris <- cor(iris)
res.alim2 <- PCA(alim, scale.unit=TRUE, quanti.sup = c(), quali.sup = c("OUVR"))
res.alim2 <- PCA(alim, scale.unit=TRUE, quanti.sup = c(), quali.sup = c("OUVR", "PRIN"))
library(FactoMineR)
help(PCA)
res.alim2 <- PCA(alim, scale.unit=TRUE, quanti.sup = c(), ind = c("OUVR", "PRIN"))
res.alim2 <- PCA(alim, scale.unit=TRUE, quanti.sup = c(), ind.sup = c("OUVR", "PRIN"))
res.alim2 <- PCA(alim, scale.unit=TRUE, quanti.sup = c(), ind.sup = c(3, 7))
summary(res.alim2, nb.dec = 2, nbelements = Inf, nbind = Inf, ncp = 3)
res.iris <- PCA(iris, scale.unit = TRUE)
res.iris <- PCA(iris, scale.unit = TRUE, quali.sup = c('Species'))
res.iris <- PCA(iris, scale.unit = TRUE, quanti.sup = c('Species'))
res.iris <- PCA(iris, scale.unit = TRUE, ind.sup = c('Species'))
res.iris <- PCA(iris, scale.unit = TRUE, quali.sup = c('Species'))
summary(res.iris, nbelements = Inf, nbind = Inf, ncp = 3)
knitr::opts_chunk$set(echo = TRUE)
res.alim2 <- PCA(alim, scale.unit=TRUE, quanti.sup = c(), ind.sup = c(8))
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(echo = TRUE)
autos <- read.table("autos.csv", sep=";",header=TRUE)
rownames(autos)<-autos$Modele
autos$Modele<-NULL
autos<-autos[,c(1:6,8)]
library(FactoMineR)
help(PCA)
res.autos<-PCA(autos, scale.unit=TRUE, quanti.sup = c("PRIX") )
summary(res.autos, nb.dec=2, nb.elements =Inf, nbind = Inf, ncp=3) #les résultats avec deux décimales, pour tous les individus, toutes les variables, sur les 3 premières CP
eigenvalues <- res.autos$eig  # pour faire l'eboulis des valeurs propres
bplt <- barplot(eigenvalues[, 2], names.arg=1:nrow(eigenvalues),
main = "Eboulis des valeurs propres",
xlab = "Principal Components",
ylab = "Percentage of variances",
col ="steelblue",
)
lines(x = bplt, eigenvalues[, 2], type="b", pch=19, col = "red")
alim <- read.table('alimentation.csv', sep=';', header=TRUE)
rownames(alim)<-alim$ROW_LABEL
alim$ROW_LABEL<-NULL
help(cor)
corr <- cor(alim)
corr
res.alim<-PCA(alim, scale.unit=TRUE, quanti.sup = c())
summary(res.alim, nb.dec = 2, nbelements = Inf, nbind = Inf, ncp = 3)
res.alim2 <- PCA(alim, scale.unit=TRUE, quanti.sup = c(), ind.sup = c(8))
summary(res.alim2, nb.dec = 2, nbelements = Inf, nbind = Inf, ncp = 3)
data(iris)
head(iris)
res.iris <- PCA(iris, scale.unit = TRUE, quali.sup = c('Species'))
summary(res.iris, nbelements = Inf, nbind = Inf, ncp = 3)
knitr::opts_chunk$set(echo = TRUE)
autos <- read.table("autos.csv", sep=";",header=TRUE)
rownames(autos)<-autos$Modele
autos$Modele<-NULL
autos<-autos[,c(1:6,8)]
library(FactoMineR)
help(PCA)
res.autos<-PCA(autos, scale.unit=TRUE, quanti.sup = c("PRIX"))
plot.CPA(res.iris)
plot.PCA(res.iris, choix = "ind", habillage = 5)
plot.PCA(res.iris, choix = "ind", habillage = 5)
plot.PCA(res.iris, choix = "ind", habillage = 5, label = none)
plot.PCA(res.iris, choix = "ind", habillage = 5)
plot.PCA(res.iris, choix = "ind", habillage = 5, label = None)
plot.PCA(res.iris, choix = "ind", habillage = 5)
plot.PCA(res.iris, choix = "ind", habillage = 5, label = NONE)
plot.PCA(res.iris, choix = "ind", habillage = 5)
plot.PCA(res.iris, choix = "ind", habillage = 5, label = NULL)
res.autos<-PCA(autos, scale.unit=TRUE, quanti.sup = c("PRIX"))
plot.PCA(res.iris, choix = "ind", habillage = 5)
plot.PCA(res.iris, choix = "ind", habillage = 5, label = NULL)
res.autos<-PCA(autos, scale.unit=TRUE, quanti.sup = c("PRIX"))
plot.PCA(res.iris, choix = "ind", habillage = 5)
plot.PCA(res.iris, choix = "ind", habillage = 5, label = "None")
res.autos<-PCA(autos, scale.unit=TRUE, quanti.sup = c("PRIX"))
plot.PCA(res.iris, choix = "ind", habillage = 5)
plot.PCA(res.iris, choix = "ind", habillage = 5, label = NA)
res.autos<-PCA(autos, scale.unit=TRUE, quanti.sup = c("PRIX"))
plot.PCA(res.iris, choix = "ind", habillage = 5)
plot.PCA(res.iris, choix = "ind", habillage = 5, label = "none")
res.autos<-PCA(autos, scale.unit=TRUE, quanti.sup = c("PRIX"))
res.iris <- PCA(iris, scale.unit = TRUE, quali.sup = c('Species'))
plot.PCA(res.iris, choix = "ind", habillage = 5)
plot.PCA(res.iris, choix = "ind", habillage = 5, label = "none")
res.iris <- PCA(iris, scale.unit = TRUE, quali.sup = c('Species'))
plot.PCA(res.iris, choix = "ind", habillage = 5, label = "none")
res.iris <- PCA(iris, scale.unit = TRUE, quali.sup = c('Species'))
plot.PCA(res.iris, choix = "ind", habillage = 5, label = "none")
res.iris <- PCA(iris, scale.unit = TRUE, quali.sup = c('Species'))
plot.PCA(res.iris, choix = "ind", habillage = 5, label = "none")
dimdesc(res.iris)
knitr::opts_chunk$set(echo = TRUE)
autos <- read.table("autos.csv", sep=";",header=TRUE)
rownames(autos)<-autos$Modele
autos$Modele<-NULL
autos<-autos[,c(1:6,8)]
library(FactoMineR)
help(PCA)
res.autos<-PCA(autos, scale.unit=TRUE, quanti.sup = c("PRIX"))
summary(res.autos, nb.dec=2, nb.elements =Inf, nbind = Inf, ncp=3) #les résultats avec deux décimales, pour tous les individus, toutes les variables, sur les 3 premières CP
eigenvalues <- res.autos$eig  # pour faire l'eboulis des valeurs propres
bplt <- barplot(eigenvalues[, 2], names.arg=1:nrow(eigenvalues),
main = "Eboulis des valeurs propres",
xlab = "Principal Components",
ylab = "Percentage of variances",
col ="steelblue",
)
lines(x = bplt, eigenvalues[, 2], type="b", pch=19, col = "red")
alim <- read.table('alimentation.csv', sep=';', header=TRUE)
rownames(alim)<-alim$ROW_LABEL
alim$ROW_LABEL<-NULL
help(cor)
corr <- cor(alim)
corr
res.alim<-PCA(alim, scale.unit=TRUE, quanti.sup = c())
summary(res.alim, nb.dec = 2, nbelements = Inf, nbind = Inf, ncp = 3)
res.alim2 <- PCA(alim, scale.unit=TRUE, quanti.sup = c(), ind.sup = c(8))
summary(res.alim2, nb.dec = 2, nbelements = Inf, nbind = Inf, ncp = 3)
data(iris)
head(iris)
res.iris <- PCA(iris, scale.unit = TRUE, quali.sup = c('Species'))
plot.PCA(res.iris, choix = "ind", habillage = 5, label = "none")
dimdesc(res.iris)
summary(res.iris, nbelements = Inf, nbind = Inf, ncp = 3)
