Ce document est une synthèse de l'état du parc social en r params$annee
en r params$nom_region
.
library(COGiter) library(rrrpls) library(tidyverse) library(glue) library(patchwork) library(purrr) library(sf) library(cartography) library(drealthemes) library(ggspatial) library(scales) library(waffle) library(ggrepel) options(knitr.kable.NA = "s")
# automatically create a bib database for R packages knitr::write_bib(c( .packages(), "bookdown", "knitr", "rmarkdown", "tidyverse", "glue", "patchwork","purrr", "viridis", "sf", "cartography","drealthemes"), "packages.bib") knitr::opts_chunk$set( echo = F, warning = F, error = F, message = F,progress = F, fig.width = 12, fig.height = 6, width = 100, cache = F )
nom <- glue("indicateurs_rpls_{params$annee}") indicateurs_rpls <- get(nom) rm(list = nom) nom <- glue("rpls_par_date_{params$annee}") rpls_par_date <- get(nom) rm(list = nom) code_region <- filter(regions,NOM_REG==params$nom_region) %>% pull(REG) %>% as.character() df <- filtrer_cog(indicateurs_rpls, reg = code_region, garder_supra = ">") %>% filter(CodeZone != "FRMETRO") %>% mutate(TypeZone=fct_relevel(TypeZone,"Communes","Epci","Départements","Régions","France")) rpls_par_date <- rpls_par_date %>% inner_join(communes %>% filter(REG == code_region))
epci_ref <- epci %>% filter(str_detect(REGIONS_DE_L_EPCI, code_region), NATURE_EPCI %in% c("ME", "CU")) %>% select(EPCI, NOM_EPCI) if (length(params$epci_ref) > 0) { epci_ref <- epci %>% filter(EPCI %in% params$epci_ref) %>% select(EPCI, NOM_EPCI) } # si pas d'epci de référence précisé, on garde les 10 epci ayant le plus de résidences principales if (length(params$epci_ref) == 0) { epci_ref <- df %>% filter(Indicateur=="Nombre de résidences principales",TypeZone=="Epci",SousEnsemble=="Ensemble du parc") %>% top_n(n=10,wt=Valeur) %>% select(EPCI=CodeZone,NOM_EPCI=Zone) } epci_geo <- epci_geo %>% left_join(epci %>% mutate(reg_param = ifelse(str_detect(REGIONS_DE_L_EPCI, code_region), 1, 0)) %>% select(EPCI, reg_param)) communes_epci_ref <- liste_zone %>% filter(TypeZone == "Communes") %>% inner_join(epci_ref) %>% select(DEPCOM = CodeZone, NOM_EPCI) epci_region <- epci_geo %>% inner_join(epci %>% filter(str_detect(REGIONS_DE_L_EPCI, code_region))) %>% summarise(funs(sum),do_union=T) region <- regions_geo %>% filter(REG == code_region) bbox <- epci_region %>% st_bbox()
annee_precedente <- as.numeric(params$annee)-1 annee_recente <- as.numeric(params$annee)-5 caption <- glue("source : RPLS {params$annee} \n carte des epci au 1er janvier 2019 \n Parc récent : logements rentrés dans le patrimoine des bailleurs depuis {annee_recente}") caption_poids <- glue("source : RPLS {params$annee}, recencement de la population 2016 \n carte des epci au 1er janvier 2019 \n Parc récent : logements rentrés dans le patrimoine des bailleurs depuis {annee_recente}")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.