Skip to content
Snippets Groups Projects
Commit ef65b22b authored by Juliette Engelaere-Lefebvre's avatar Juliette Engelaere-Lefebvre
Browse files

Prod_elec_renouvelable : mettre à NA les EPCI à cheval avant 2018

closes #64

suppresion du total Fce métro pour fichiers foncier
relates to #86
parent c1d8e07f
1 merge request!40Resolve "Mieux gérer les totaux de cogification"
......@@ -74,6 +74,12 @@ zones_r52 <- filter(liste_zone, grepl("52", REG)) %>%
unite(col = "IdZone", CodeZone, TypeZone, sep = "_") %>%
mutate(across(everything(), fct_drop))
epci_a_cheval <- liste_zone %>%
filter(grepl("52", REG), TypeZone == "Epci") %>%
rowwise() %>%
filter(length(REG) > 1) %>%
pull(CodeZone)
prod_elec_renouv <- prod_elec_renouv1 %>%
select(-estimation, -type_estimation) %>%
unite("IdZone", CodeZone, TypeZone) %>%
......@@ -84,10 +90,11 @@ prod_elec_renouv <- prod_elec_renouv1 %>%
left_join(liste_zone %>% select(CodeZone, TypeZone, Zone),
by = c("CodeZone", "TypeZone")) %>%
mutate_if(is.factor, as.character) %>%
rename(variable = indicateur) %>%
rename(variable = indicateur) %>%
# Prod_elec_renouvelable : mettre à NA les EPCI à cheval avant 2018
mutate(valeur = if_else(CodeZone %in% epci_a_cheval & date <= "2017-12-31", NA_real_, valeur)) %>%
pivot_wider(names_from = variable, values_from = valeur)
# versement dans le sgbd/datamart.portrait_territoires + documentation -------------
# doublons - TRUE attendu
......@@ -98,7 +105,6 @@ prod_elec_renouv %>%
source("R/poster_documenter_ind.R")
poster_documenter_ind(df = prod_elec_renouv, nom_table_sgbd = "cogifiee_prod_elec_renouv",
comm_source_en_plus = "")
poster_documenter_ind(df = prod_elec_renouv, comm_source_en_plus = "")
rm(list=ls())
......@@ -7,7 +7,7 @@ source("R/cogifier_it.R")
source("R/poster_doc_post_cogifier.R")
# cogification
cogifier_it(nom_source = "fichier_foncier_artificialisation")
cogifier_it(nom_source = "fichier_foncier_artificialisation", metro = FALSE)
# versement dans le sgbd/datamart.portrait_territoires et metadonnee -------------
poster_documenter_post_cogifier(source = "fichier_foncier_artificialisation")
......
......@@ -40,7 +40,7 @@ indicateur_statut_occupation_des_rp <- cogifiee_statut_occupation_des_rp %>%
# versement dans le sgbd/datamart.portrait_territoiresdes données et de leur métadonnées -------------
source("R/poster_documenter_ind.R", encoding = "UTF-8")
poster_documenter_ind(df = indicateur_statut_occupation_des_rp, nom_table_sgbd = "indicateur_statut_occupation_des_rp",
poster_documenter_ind(df = indicateur_statut_occupation_des_rp, nom_table_sgbd = "indicateur_statut_occupation_des_rp",
comm_source_en_plus = "")
rm(list=ls())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment