From ef9cef85680d496f30a10edf20865a917bdbf1e2 Mon Sep 17 00:00:00 2001
From: Daniel Kalioudjoglou
 <daniel.kalioudjoglou@developpement-durable.gouv.fr>
Date: Fri, 9 Feb 2024 11:37:51 +0100
Subject: [PATCH] remplacer na par nc dans tableau

---
 R/creer_tableau_synthese_annuelle.R                         | 3 ++-
 R/creer_tableau_synthese_trimestrielle.R                    | 5 +++--
 .../templates/ecln_conjoncture/skeleton/skeleton.Rmd        | 6 ++++++
 man/indic_ecln.Rd                                           | 2 +-
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/R/creer_tableau_synthese_annuelle.R b/R/creer_tableau_synthese_annuelle.R
index 954b7a5..79e9280 100644
--- a/R/creer_tableau_synthese_annuelle.R
+++ b/R/creer_tableau_synthese_annuelle.R
@@ -35,6 +35,7 @@ creer_tableau_synthese_annuel <- function(data = indic_ecln,
       "PrixM2 - Appartements"
     )
   }
+
   input <- indic_ecln %>%
     dplyr::filter(
       .data$Indicateur %in% indic,
@@ -71,7 +72,7 @@ creer_tableau_synthese_annuel <- function(data = indic_ecln,
     kableExtra::row_spec(1:2, bold = T, background = "#f0f0f5") %>%
     kableExtra::add_header_above(c(" " = 1, "Ventes" = 2, "Mises en vente" = 2, "Encours" = 2, "Prix au m2" = 2)) %>%
     kableExtra::add_indent(c(3:nombre_zone)) %>%
-    kableExtra::footnote(general_title="",general = "NA : donn\u00e9es non communiqu\u00e9es (secret statistique)")
+    kableExtra::footnote(general_title="",general = "NC : donn\u00e9es non communiqu\u00e9es (secret statistique)")
   if ("ABC" %in% type_zone) {
     res <- res %>%
       kableExtra::row_spec(nombre_fr_dep_reg:nombre_zone, bold = T, background = "#bebece")
diff --git a/R/creer_tableau_synthese_trimestrielle.R b/R/creer_tableau_synthese_trimestrielle.R
index be3226f..c8da328 100644
--- a/R/creer_tableau_synthese_trimestrielle.R
+++ b/R/creer_tableau_synthese_trimestrielle.R
@@ -34,6 +34,7 @@ creer_tableau_synthese_trimestrielle <- function(data = indic_ecln,
       "PrixM2 - Appartements"
     )
   }
+
   indic_ecln %>%
     dplyr::filter(
       .data$Indicateur %in% indic,
@@ -58,7 +59,7 @@ creer_tableau_synthese_trimestrielle <- function(data = indic_ecln,
       by = c("TypeZone", "Zone")
     ) %>%
     dplyr::arrange(.data$Zone) %>%
-    dplyr::select(2, 6, 10, 4, 8, 3, 7, 5, 9) %>%
+    dplyr::select(2, 6, 10, 4, 8, 3, 7, 5, 9)%>%
     knitr::kable("html",
       col.names = c(
         "Zone", "Sur le dernier trimestre", "Evolution sur un an (en %)",
@@ -72,6 +73,6 @@ creer_tableau_synthese_trimestrielle <- function(data = indic_ecln,
     kableExtra::kable_styling(font_size = 12) %>%
     kableExtra::row_spec(1:2, bold = T, background = "#f0f0f5") %>%
     kableExtra::add_header_above(c(" " = 1, "Ventes" = 2, "Mises en vente" = 2, "Encours" = 2, "Prix au m2" = 2)) %>%
-    kableExtra::footnote(general_title="",general = "NA : donn\u00e9es non communiqu\u00e9es (secret statistique)")
+    kableExtra::footnote(general_title="",general = "NC : donn\u00e9es non communiqu\u00e9es (secret statistique)")
 
 }
diff --git a/inst/rmarkdown/templates/ecln_conjoncture/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/ecln_conjoncture/skeleton/skeleton.Rmd
index b33bdc3..277d030 100644
--- a/inst/rmarkdown/templates/ecln_conjoncture/skeleton/skeleton.Rmd
+++ b/inst/rmarkdown/templates/ecln_conjoncture/skeleton/skeleton.Rmd
@@ -99,12 +99,14 @@ A COMPLETER
 #### Chiffres trimestriels
 
 ```{r logementstableautrim}
+opts <- options(knitr.kable.NA = "NC")
 creer_tableau_synthese_trimestrielle(type_logement = "logement")
 ```
 
 #### Chiffres cumulés sur les 4 derniers trimestres
 
 ```{r logementstableaucumul}
+opts <- options(knitr.kable.NA = "NC")
 creer_tableau_synthese_annuel(
   type_logement = "logement",
   type_zone = typezone
@@ -213,12 +215,14 @@ A COMPLETER
 #### Chiffres trimestriels
 
 ```{r collectiftableautrim}
+opts <- options(knitr.kable.NA = "NC")
 creer_tableau_synthese_trimestrielle(type_logement = "collectif")
 ```
 
 #### Chiffres cumulés sur les 4 derniers trimestres
 
 ```{r collectiftableaucumul}
+opts <- options(knitr.kable.NA = "NC")
 creer_tableau_synthese_annuel(
   type_logement = "collectif",
   type_zone = typezone
@@ -329,12 +333,14 @@ A COMPLETER
 #### Chiffres trimestriels
 
 ```{r individueltableautrim}
+opts <- options(knitr.kable.NA = "NC")
 creer_tableau_synthese_trimestrielle(type_logement = "individuel")
 ```
 
 #### Chiffres cumulés sur les 4 derniers trimestres
 
 ```{r individueltableaucumul}
+opts <- options(knitr.kable.NA = "NC")
 creer_tableau_synthese_annuel(
   type_logement = "individuel",
   type_zone = typezone
diff --git a/man/indic_ecln.Rd b/man/indic_ecln.Rd
index b25a6d1..3a09558 100644
--- a/man/indic_ecln.Rd
+++ b/man/indic_ecln.Rd
@@ -6,7 +6,7 @@
 \alias{indic_ecln}
 \title{Table contenant les différents indicateurs de la source ecln utiles pour la publication.}
 \format{
-Table de 2197156 lignes et 9 colonnes:
+Table de 96720 lignes et 10 colonnes:
 \describe{
 \item{TypeZone}{Type de territoire}
 \item{CodeZone}{Code du territoire}
-- 
GitLab