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

modification texte automatique

parent 0f4d3d04
No related branches found
No related tags found
1 merge request!7modification texte automatique
Pipeline #218235 failed
Package: propre.ecln
Title: Publication conjoncturellle sur la commercialisation de logement neufs
Title: Publication conjoncturellle sur la commercialisation de logement
neufs
Version: 0.0.0.9000
Authors@R:
person(given = "Maël",
family = "THEULIERE",
role = c("aut", "cre"),
email = "mael.theuliere@gmail.com",
person("Maël", "THEULIERE", , "mael.theuliere@gmail.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-5146-699X"))
Description: Template Rmarkdown et fonctions pour réaliser la publication conjoncturellle sur la commercialisation de logement neufs.
Description: Template Rmarkdown et fonctions pour réaliser la publication
conjoncturellle sur la commercialisation de logement neufs.
License: GPL (>= 3)
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
Depends:
R (>= 2.10)
Imports:
attempt,
COGiter,
dplyr,
lubridate,
stringr,
drealdown,
forcats,
geofacet,
ggforce,
......@@ -25,19 +22,23 @@ Imports:
ggspatial,
glue,
gouvdown,
mapfactory,
scales,
magrittr,
rlang,
grid,
kableExtra,
knitr,
lubridate,
magrittr,
mapfactory,
rlang,
scales,
sf,
stringr,
tidyr,
attempt,
drealdown,
sf
utils
Remotes:
gitlab::dreal-datalab/drealdown,
gitlab::dreal-datalab/mapfactory,
MaelTheuliere/COGiter
Depends:
R (>= 2.10)
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
......@@ -75,6 +75,7 @@ format_fr_nb <- function(x, dec = 1, big_mark, sign = FALSE) {
#' @param indicateur Ventes, Mises en vente ou encours
#' @param type_logement Appartements ou Maisons
#' @param type_indicateur cumul annuel ou valeur trimestrielle
#' @param texte_log texte en fonction du type de logement
#'
#' @return du code html
#' @export
......@@ -84,7 +85,8 @@ format_fr_nb <- function(x, dec = 1, big_mark, sign = FALSE) {
creer_chiffres_clefs_ecln <- function(data = indic_ecln,
type_logement = "Logements",
indicateur = "Ventes",
type_indicateur = "Trimestriel") {
type_indicateur = "Trimestriel",
texte_log = "logements neufs vendus") {
indic <- paste0(indicateur, " - ", type_logement)
df <- data %>%
......@@ -99,7 +101,7 @@ creer_chiffres_clefs_ecln <- function(data = indic_ecln,
valeur = format_fr_nb(df$Valeur, dec = 0),
evolution = format_fr_pct(df$TauxEvolution12Mois, dec = 1)
)
res <- glue::glue("{drealdown::my_icon('la-building', size=2)} <b>{val$valeur}</b> logements neufs vendus au {val$periode}<br>
res <- glue::glue("{drealdown::my_icon('la-building', size=2)} <b>{val$valeur}</b> {texte_log} au {val$periode}<br>
{drealdown::my_icon('la-line-chart', size=2)} <b>{val$evolution}</b> sur un an")
return(res)
}
......@@ -115,7 +115,7 @@ creer_graphique_evolution_trim(
<hr>
`r creer_chiffres_clefs_ecln(type_logement = 'Appartements')`
`r creer_chiffres_clefs_ecln(type_logement = 'Appartements', texte_log = "appartements neufs vendus")`
<hr>
......@@ -146,7 +146,7 @@ creer_graphique_evolution_trim(
<hr>
`r creer_chiffres_clefs_ecln(type_logement = 'Maisons')`
`r creer_chiffres_clefs_ecln(type_logement = 'Maisons', texte_log = "maisons neuves vendues")`
<hr>
......
......@@ -8,7 +8,8 @@ creer_chiffres_clefs_ecln(
data = indic_ecln,
type_logement = "Logements",
indicateur = "Ventes",
type_indicateur = "Trimestriel"
type_indicateur = "Trimestriel",
texte_log = "logements neufs vendus"
)
}
\arguments{
......@@ -19,6 +20,8 @@ creer_chiffres_clefs_ecln(
\item{indicateur}{Ventes, Mises en vente ou encours}
\item{type_indicateur}{cumul annuel ou valeur trimestrielle}
\item{texte_log}{texte en fonction du type de logement}
}
\value{
du code html
......
......@@ -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 1596672 lignes et 9 colonnes:
Table de 91884 lignes et 9 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