Skip to content
Snippets Groups Projects
Commit 88337873 authored by Daniel.Kalioudjoglou's avatar Daniel.Kalioudjoglou
Browse files

Adaptation pour faire fonctionner le rmd

modification du format date
export des donees calees
parent c30a52d1
No related branches found
No related tags found
1 merge request!3Adaptation pour faire fonctionner le rmd
Pipeline #175979 failed
...@@ -350,7 +350,8 @@ cale <- bind_rows (Cale_cons, Cale_typ_tot) ...@@ -350,7 +350,8 @@ cale <- bind_rows (Cale_cons, Cale_typ_tot)
# Liste des indicateurs à caler # Liste des indicateurs à caler
Indic_a_caler <- str_subset(levels(indic_ecln$Indicateur), c("Encours","Mises")) # Indic_a_caler <- str_subset(levels(indic_ecln$Indicateur), c("Encours","Mises"))
Indic_a_caler <- c( str_subset(levels(indic_ecln$Indicateur), "Encours"), str_subset(levels(indic_ecln$Indicateur), "Mises") )
indic_ecln_ss_com <- indic_ecln_ss_com %>% indic_ecln_ss_com <- indic_ecln_ss_com %>%
mutate(indic_calage = ifelse(TypeZone %in% c("France", "Régions", "Départements") & mutate(indic_calage = ifelse(TypeZone %in% c("France", "Régions", "Départements") &
...@@ -420,7 +421,8 @@ Indic_final<- Indic_final %>% ...@@ -420,7 +421,8 @@ Indic_final<- Indic_final %>%
# Dans la table finale, on aura la source, le type de l'indicateur (trimestriel, annuel) # Dans la table finale, on aura la source, le type de l'indicateur (trimestriel, annuel)
# Appel de la fonction FormatDate
source("R/FormatDate.R")
indic_ecln_trim <- Indic_final %>% indic_ecln_trim <- Indic_final %>%
select(-Valeur_cumul) %>% select(-Valeur_cumul) %>%
...@@ -437,7 +439,7 @@ indic_ecln_trim <- Indic_final %>% ...@@ -437,7 +439,7 @@ indic_ecln_trim <- Indic_final %>%
gather(Indicateur, Valeur, Encours_Appartements:PrixPar_Logements) %>% gather(Indicateur, Valeur, Encours_Appartements:PrixPar_Logements) %>%
mutate( mutate(
Indicateur = str_replace_all(Indicateur, "_", " - "), Indicateur = str_replace_all(Indicateur, "_", " - "),
# Periode = FormatDate(Periode, Periodicite = "Trim", sep = "T"), Periode = FormatDate(Periode, Periodicite = "Trim", sep = "T"),
Source = "ECLN", Source = "ECLN",
TypeIndicateur = "Trimestriel" TypeIndicateur = "Trimestriel"
) )
...@@ -457,7 +459,7 @@ indic_ecln_cumul <- Indic_final %>% ...@@ -457,7 +459,7 @@ indic_ecln_cumul <- Indic_final %>%
gather(Indicateur, Valeur, Encours_Appartements:PrixPar_Logements) %>% gather(Indicateur, Valeur, Encours_Appartements:PrixPar_Logements) %>%
mutate( mutate(
Indicateur = str_replace_all(Indicateur, "_", " - "), Indicateur = str_replace_all(Indicateur, "_", " - "),
# Periode = FormatDate(Periode, Periodicite = "Trim", sep = "T"), Periode = FormatDate(Periode, Periodicite = "Trim", sep = "T"),
Source = "ECLN", Source = "ECLN",
TypeIndicateur = "Cumul annuel" TypeIndicateur = "Cumul annuel"
) )
...@@ -481,7 +483,7 @@ indic_ecln_non_secret <- bind_rows(indic_ecln_cumul, indic_ecln_trim) %>% ...@@ -481,7 +483,7 @@ indic_ecln_non_secret <- bind_rows(indic_ecln_cumul, indic_ecln_trim) %>%
mutate_if(is.character, as.factor) %>% mutate_if(is.character, as.factor) %>%
mutate(TypeZone = fct_relevel(TypeZone, "France", "Régions", "Départements", "Epci")) mutate(TypeZone = fct_relevel(TypeZone, "France", "Régions", "Départements", "Epci"))
indic_ecln <- indic_ecln_non_secret
usethis::use_data(indic_ecln, overwrite = TRUE)
usethis::use_data(indic_ecln_non_secret, overwrite = TRUE)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment