Commit f1fe2ee9 authored by Ekaterina's avatar Ekaterina

rapport_test

parent cd79e179
......@@ -38,7 +38,7 @@ RUN apt-get update \
RUN Rscript -e "install.packages(c('devtools','knitr','rmarkdown','shiny','RCurl'), repos = 'https://cran.rstudio.com')"
RUN Rscript -e "source('https://cdn.rawgit.com/road2stat/liftrlib/aa132a2d/install_cran.R');install_cran(c('sp','FactoMineR','devtools','plotrix','knitr','huxtable','magrittr','psych','factoextra','sf','rgdal','cartography','readr'))"
RUN Rscript -e "source('https://cdn.rawgit.com/road2stat/liftrlib/aa132a2d/install_cran.R');install_cran(c('sp','FactoMineR','devtools','plotrix','knitr','huxtable','magrittr','psych','factoextra','sf','rgdal','cartography','readr','corrplot'))"
COPY templates/ /templates/
RUN ls /templates/
......
container_name: liftr_container_c68f4b0e_7166_4616_b45a_1d03fbd406b0
image_name: document_test_Ekaterina
docker_build_cmd: docker build --no-cache=false --rm=true -t="document_test_Ekaterina"
/home/ekaterina/m2_G2M/rapport/docs
docker_run_cmd: docker run --rm --name "liftr_container_c68f4b0e_7166_4616_b45a_1d03fbd406b0"
-u `id -u $USER` -v "/home/ekaterina/m2_G2M/rapport/docs:/liftrroot/" document_test_Ekaterina
Rscript -e "library('knitr');library('rmarkdown');library('shiny');setwd('/liftrroot/');render(input
= 'document_test_Ekaterina.Rmd')"
This diff is collapsed.
container_name: liftr_container_a11015af_67df_477e_ac5b_a9af83e57f15
image_name: document_test_ekaterina
docker_build_cmd: docker build --no-cache=false --rm=true -t="document_test_ekaterina"
/home/ekaterina/m2_G2M/rapport/docs
docker_run_cmd: docker run --rm --name "liftr_container_a11015af_67df_477e_ac5b_a9af83e57f15"
-u `id -u $USER` -v "/home/ekaterina/m2_G2M/rapport/docs:/liftrroot/" document_test_ekaterina
Rscript -e "library('knitr');library('rmarkdown');library('shiny');setwd('/liftrroot/');render(input
= 'document_test_ekaterina.Rmd')"
......@@ -18,34 +18,15 @@ library('dplyr')
# Chargement des données
donnees <- read.csv("../data/traitees/tab_frequence_2015_viv.csv", encoding="UTF-8", head=T)
donnees_persona <- read.csv("../data/traitees/tab_frequence_2015_pers.csv", encoding="UTF-8", head=T)
colnames(donnees)
colnames(donnees_persona)
#colnames(donnees)
#colnames(donnees_persona)
```
```{r Exemple, une variable}
####Exemple sur 1 variable
#Choix de variable CLAVIVP
CLAVIVP <- select(donnees, starts_with("CLAVIVP"))
colnames(CLAVIVP)
#Ajout d'identificateur (code_mun)
row.names(CLAVIVP)<- donnees$code_mun
res.ca <- CA (CLAVIVP, graph = FALSE)
#valeurs propres
get_eigenvalue(res.ca)
#visualisation des valeurs propres
p <- fviz_screeplot (res.ca, addlabels = TRUE, label = "CLAVIVP", ylim = c(0, 70))
p + labs(title = "Valeurs Propres, CLAVIVP",
x = "Principal Components", y = "% of variances")
fviz_ca_biplot (res.ca, label="col", alpha.row=0.3, col.row = "#00AFBB", col.col = "#0e07e5", repel = TRUE)
#faire le graphique de contributions sur le premiees 5 axes
corrplot(col$contrib, is.corr=FALSE, title = "Contributions des fréquences actives")
corrplot(col$cos2, is.corr=FALSE, title = "Qualités de représentation (COS2) des fréquences actives")
col <- get_ca_col(res.ca)
```
......@@ -105,18 +86,13 @@ for (i in 1:6){
```{r test sur exemple}
#Pour accéder aux résultats de chaque AFC :resAFC$CLAVIVP
resAFC$CLAVIVP
#resAFC$CLAVIVP
clavivp <-resAFC$CLAVIVP
clavivp$svd
clavivp$col
#visualisation des valeurs propres
fviz_screeplot (resAFC$CLAVIVP, addlabels = TRUE, ylim = c(0, 70))
a <- fviz_ca_biplot (resAFC$CLAVIVP, label="col", alpha.row=0.3, col.row = "#00AFBB", col.col = "#0e07e5", repel = TRUE)
#fviz_screeplot (resAFC$CLAVIVP, addlabels = TRUE, ylim = c(0, 70))
#fviz_ca_biplot (resAFC$CLAVIVP, label="col", alpha.row=0.3, col.row = "#00AFBB", col.col = "#0e07e5", repel = TRUE)
jpeg(filename = "../images/AFC/testClavivp.jpeg")
plot(a)
dev.off()
```
......@@ -129,10 +105,15 @@ for (var in variables) {
x = "Facteur", y = "% de variance"))
#creation de nom unique pour chaque image et sauvegarde en jpeg
nam <- paste("../images/AFC/valeurs_propres_viv_", var, ".jpeg", sep="")
#nam1<- paste("![Variances expliquées de la variable ", var, "](../../static/img/AFC/valeurs_propres_viv_", var, ".jpeg", sep="")
assign(nam, var)
# assign(nam1, var)
jpeg(filename = nam)
plot(final.plot)
dev.off()
#print(nam1)
}
......@@ -140,7 +121,7 @@ for (var in variables) {
```
```{r Valeurs prpres Persona}
```{r Valeurs propres Persona}
#visualisation des valeurs propres pour chaque variable
for (var in variables_pers) {
vartemp <- resAFC_pers[[var]]
......@@ -148,11 +129,13 @@ for (var in variables_pers) {
print(final.plot + labs(title = paste("Valeurs propres", var, sep = " "),
x = "Facteur", y = "% de variance"))
nam <- paste("../images/AFC/valeurs_propres_pers_", var, ".jpeg", sep="")
nam1 <- paste("![Variances expliquées de la variable ", var, "](../../static/img/AFC/valeurs_propres_viv_", var, ".jpeg", sep="")
assign(nam, var)
assign(nam1,var)
jpeg(filename = nam)
plot(final.plot)
dev.off()
print(nam1)
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment