Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ptz-communal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DREAL Pays de la Loire
Centre de Services de la Donnée
Requêtes serveur CGDD
ptz-communal
Commits
7eea6bbe
Commit
7eea6bbe
authored
9 months ago
by
Daniel.Kalioudjoglou
Browse files
Options
Downloads
Patches
Plain Diff
premier commit
parent
f50e06c1
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+4
-0
4 additions, 0 deletions
.gitignore
chargement_ptz.R
+36
-0
36 additions, 0 deletions
chargement_ptz.R
ptz-communal.Rproj
+16
-0
16 additions, 0 deletions
ptz-communal.Rproj
with
56 additions
and
0 deletions
.gitignore
0 → 100644
+
4
−
0
View file @
7eea6bbe
.Rproj.user
.Rhistory
.RData
.Ruserdata
This diff is collapsed.
Click to expand it.
chargement_ptz.R
0 → 100644
+
36
−
0
View file @
7eea6bbe
library
(
readr
)
library
(
dplyr
)
millesime
=
2023
# path <- paste("/nfs/data/partage-PTZ-EPTZ/PTZ-EPTZ/BASE_PTZ_DHUP_",millesime,"_DREAL.csv")
BASE_PTZ_DHUP
<-
read_delim
(
paste0
(
"/nfs/data/partage-PTZ-EPTZ/PTZ-EPTZ/BASE_PTZ_DHUP_"
,
millesime
,
"_DREAL.csv"
),
delim
=
";"
,
escape_double
=
FALSE
,
trim_ws
=
TRUE
)
ptz
<-
BASE_PTZ_DHUP
%>%
# cpfl = code postal , cins = code insee, cdco = code commune déclaré
# lcom = libéllé commune, timm = type logement (1 = individuel, 2 = collectif)
# tope = type d'opération :
# 1 : achat neuf
# 2 : Construction de maison individuelle (achat du terrain compris)
# 3 : Construction de maison individuelle (hors achat du terrain)
# 4 : Acquisition amélioration pour les acquisitions seules
# 5 : Transformation de locaux non destinés à l’habitation en logement
# 6 : Levée d’option en location-accession, pour le 1er locataire
# 7 : Acquisition d’un logement avec travaux de remise à neuf
select
(
cpfl
,
cins
,
cdco
,
lcom
,
timm
,
tope
)
%>%
mutate
(
type_logt
=
case_when
(
timm
==
1
~
"individuel"
,
timm
==
2
~
"collectif"
,
TRUE
~
"non_renseigne"
),
etat_logt
=
case_when
(
tope
%in%
c
(
1
,
2
,
3
)
~
"neuf"
,
tope
%in%
c
(
4
,
5
,
6
,
7
)
~
"ancien"
,
TRUE
~
"non_renseigne"
)
)
%>%
rename
(
code_insee
=
cins
)
%>%
group_by
(
code_insee
,
type_logt
,
etat_logt
)
%>%
summarise
(
nb_logt
=
length
(
code_insee
))
%>%
ungroup
()
#controle
nb_lgts
<-
ptz
%>%
pull
(
nb_logt
)
%>%
sum
()
This diff is collapsed.
Click to expand it.
ptz-communal.Rproj
0 → 100644
+
16
−
0
View file @
7eea6bbe
Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
AutoAppendNewline: Yes
StripTrailingWhitespace: Yes
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment