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

Intégration PLH 2024 - closes #51

parent 31657448
No related branches found
No related tags found
No related merge requests found
Pipeline #469520 passed
......@@ -8,7 +8,7 @@ output:
toc: yes
toc_depth: '2'
params:
annee: "2023"
annee: "2024"
sgbd: TRUE
---
......@@ -26,9 +26,6 @@ library(COGiter)
library(COGugaison)
library(readODS)
library(datalibaba)
library(RPostgres)
library(rpostgis)
library(DBI)
library(sf)
# devtools::install_github("pachevalier/tricky")
library(tricky)
......@@ -132,15 +129,8 @@ On réunit au préalable ces informations.
```{r mise a jour attributs epci, message=FALSE, warning=FALSE, results = FALSE}
# siège des EPCI
telech <- tempfile()
download.file(url = paste0("https://www.banatic.interieur.gouv.fr/V5/fichiers-en-telechargement/telecharger.php?zone=N&date=01/01/",
params$annee, "&format=E"),
destfile = paste0(telech, "siege_epci.csv"))
siege_epci <- readr::read_tsv(paste0(telech, "siege_epci.csv"), locale = locale("fr", encoding = "latin1")) %>%
set_standard_names() %>%
select(EPCI = `n°_siren`, departement_siege) %>%
separate(departement_siege, into = c("dep", NA), sep = " - ") %>%
distinct %>%
siege_epci <- COGiter::epci %>%
select(EPCI, dep = DEP_SIEGE_EPCI) %>%
mutate(across(c(dep, EPCI), as.character))
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment