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

Merge branch...

Merge branch '14-corrections-a-apporter-a-la-sortie-html-faite-par-juliette-en-juin-2023-ticket-4-modifier-l' into 'master'

adaptation de graphiques

Closes #14

See merge request !8
parents fbe5b14a c3b05674
No related branches found
No related tags found
1 merge request!8adaptation de graphiques
Pipeline #220364 failed
......@@ -2,9 +2,11 @@ Package: propre.ecln
Title: Publication conjoncturellle sur la commercialisation de logement
neufs
Version: 0.0.0.9000
Authors@R:
Authors@R: c(
person("Maël", "THEULIERE", , "mael.theuliere@gmail.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-5146-699X"))
comment = c(ORCID = "0000-0002-5146-699X")),
person("Daniel", "Kalioudjoglou", , "daniel.kalioudjoglou@developpement-durable.gouv.fr", role = "aut")
)
Description: Template Rmarkdown et fonctions pour réaliser la publication
conjoncturellle sur la commercialisation de logement neufs.
License: GPL (>= 3)
......@@ -37,7 +39,7 @@ Imports:
Remotes:
gitlab::dreal-datalab/drealdown,
gitlab::dreal-datalab/mapfactory,
MaelTheuliere/COGiter
maeltheuliere/COGiter
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
......
......@@ -44,6 +44,7 @@ importFrom(ggplot2,coord_flip)
importFrom(ggplot2,coord_sf)
importFrom(ggplot2,element_blank)
importFrom(ggplot2,element_rect)
importFrom(ggplot2,element_text)
importFrom(ggplot2,facet_wrap)
importFrom(ggplot2,geom_area)
importFrom(ggplot2,geom_bar)
......
......@@ -10,7 +10,7 @@
#' @importFrom dplyr select distinct pull filter mutate
#' @importFrom forcats fct_recode
#' @importFrom ggforce geom_mark_circle
#' @importFrom ggplot2 ggplot aes geom_line geom_point margin theme labs guides scale_y_continuous scale_x_date
#' @importFrom ggplot2 ggplot aes geom_line geom_point margin theme labs guides scale_y_continuous scale_x_date element_text
#' @importFrom glue glue
#' @importFrom gouvdown gouv_colors scale_color_gouv_discrete scale_fill_gouv_discrete
#' @importFrom grid unit
......@@ -77,14 +77,18 @@ creer_graphique_evolution_trim <- function(data = indic_ecln,
fill = .data$TypeIndicateur,
description = .data$description
),
label.buffer = grid::unit(5, "mm"),
label.buffer = grid::unit(5, "mm"), #longueur du trait
expand = grid::unit(2, "mm"),
label.margin = ggplot2::margin(2, 5, 2, 5, "mm"),
label.colour = "white",
alpha = .5,
label.fill = gouvdown::gouv_colors("bleu_france")
label.margin = ggplot2::margin(2, 5, 2, 5, "mm"), #marges autour du texte (haut, gauche, bas, droite)
# label.colour = "white", #couleur du texte
label.fontsize = 9,
label.colour = gouvdown::gouv_colors("bleu_france"),
alpha = 0.5, #transparence du cercle
label.fill = NA
# label.fill = gouvdown::gouv_colors("bleu_france") #couleur de la boite d'annotation
) +
ggplot2::theme(legend.position = "bottom") +
ggplot2::theme(legend.position = "bottom",
legend.title = element_blank()) +
gouvdown::scale_color_gouv_discrete(palette = "pal_gouv_qual2") +
gouvdown::scale_fill_gouv_discrete(palette = "pal_gouv_qual2") +
ggplot2::labs(
......@@ -92,8 +96,9 @@ creer_graphique_evolution_trim <- function(data = indic_ecln,
y = "Nombre de ventes",
title = titre,
subtitle = sous_titre,
caption = "Source : ECLN\nMoyenne Annuelle : Valeur observ\u00e9e en moyenne sur les 4 derniers trimestres"
caption = "Source : ECLN\nMoyenne annuelle : Valeur observ\u00e9e en moyenne sur les 4 derniers trimestres"
) +
ggplot2::theme(plot.caption = element_text(size = 10))+
ggplot2::guides(fill = F) +
ggplot2::scale_y_continuous(labels = function(l) format(l, scientific = FALSE, big.mark = " ", decimal.mark = ","), limits = c(0, NA)) +
ggplot2::scale_x_date(date_breaks = "1 year", date_labels = "%Y", limits = c(min(per), max(per) + months(12)))
......
......@@ -23,3 +23,5 @@ usethis::use_package('kableExtra')
usethis::use_package('knitr')
usethis::use_package('tidyr')
usethis::use_r("tableau_synthese_trimestrielle")
attachment::att_amend_desc()
......@@ -83,7 +83,7 @@ A COMPLETER
::: {.col-md-7}
<br> <br> <br> <br> <br>
```{r, logements,fig.height=5, fig.width=6}
```{r, logements,fig.height=6, fig.width=6}
creer_graphique_evolution_trim(
indicateur = "Ventes - Logements",
titre = "Ventes de logements neufs \nen Pays de la Loire"
......@@ -103,7 +103,7 @@ creer_graphique_evolution_trim(
::: {.col-md-7}
<br> <br> <br> <br> <br>
```{r, logements_coll,fig.height=5, fig.width=6}
```{r, logements_coll,fig.height=6, fig.width=6}
creer_graphique_evolution_trim(
indicateur = "Ventes - Appartements",
titre = "Ventes d'appartements neufs \nen Pays de la Loire"
......@@ -134,7 +134,7 @@ A COMPLETER
<div class = "row">
::: {.col-md-7}
```{r logements_indiv,fig.height=5, fig.width=6}
```{r logements_indiv,fig.height=6, fig.width=6}
creer_graphique_evolution_trim(
indicateur = "Ventes - Maisons",
titre = "Ventes de maisons neuves \nen Pays de la Loire"
......
......@@ -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 91884 lignes et 9 colonnes:
Table de 91884 lignes et 10 colonnes:
\describe{
\item{TypeZone}{Type de territoire}
\item{CodeZone}{Code du territoire}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment