# 1. Importer les données

```{r}
univ <- read.table("https://r-stat-sc-donnees.github.io/universite.csv", sep = ";", 
                   header = T, row.names = 1)
summary(univ)
univ[1:4,1:3]
```

# 2 et 3. Paramétrer et réaliser l’AFC

```{r,message=FALSE,warning=FALSE}
library(FactoMineR)
res.ca <- CA(univ, col.sup = 7:12)
summary(res.ca, nb.dec = 2, ncp = 2, nbelements = 3)
```

# 4. Choisir le nombre d’axes

```{r,fig.width=6,fig.height=5}
barplot(res.ca$eig[,2], names = paste("Dim", 1:nrow(res.ca$eig)))
```

# 5. Visualiser les résultats

```{r,message=FALSE,warning=FALSE}
plot(res.ca, invisible = c("col","col.sup"))
```

```{r,message=FALSE,warning=FALSE}
# axes 3 et 4
plot(res.ca, axes = 3:4)
```

# Factoshiny

```{r,message=FALSE,warning=FALSE, eval = FALSE}
library(Factoshiny)
res.shiny <- CAshiny(univ)
```



