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

creation script ecoptz

parent a65efa8a
Branches
No related tags found
No related merge requests found
library(readr)
library(dplyr)
millesime = 2023
# path <- paste("/nfs/data/partage-PTZ-EPTZ/PTZ-EPTZ/BASE_PTZ_DHUP_",millesime,"_DREAL.csv")
BASE_EPZ_DHUP<- read_delim(paste0("/nfs/data/partage-PTZ-EPTZ/PTZ-EPTZ/BASE_EPZ_DHUP_",millesime,"_DREAL.csv"),
delim = ";", escape_double = FALSE, trim_ws = TRUE)
eco_ptz <- BASE_EPZ_DHUP %>%
# CPLA = code postal , CINS = code insee, CINC = code insee calculé
# VILL = ville du logement, NALO = nature du logement (1 = maison individuelle, 2 = appartement)
select (CPLA,CINS,CINC,VILL,NALO) %>%
mutate(type_logt = case_when(
NALO == 1 ~ "individuel",
NALO == 2 ~ "collectif",
TRUE ~ "non_renseigne")) %>%
rename(code_insee = CINC) %>%
group_by(code_insee,type_logt) %>%
summarise(nb_logt = length(code_insee)) %>%
ungroup()
#controle
nb_lgts <- eco_ptz %>% pull(nb_logt) %>% sum()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment