diff --git a/data-raw/chargement_ptz.R b/data-raw/chargement_ptz.R index ecfb27eaaa192712bc263f9cc5c05501849701af..f67798a21390dade95502e1df34543e0b916a84f 100644 --- a/data-raw/chargement_ptz.R +++ b/data-raw/chargement_ptz.R @@ -36,10 +36,7 @@ ptz<-rbind( cbind(aggregate(valeur~depcom+date,ptz[ptz$variable>100 & ptz$variable<200,],sum),variable="nb_ptz.individuel"), cbind(aggregate(valeur~depcom+date,ptz[ptz$variable>200,],sum),variable="nb_ptz.collectif"), cbind(aggregate(valeur~depcom+date,ptz[substr(ptz$variable,2,2)==1,],sum),variable="nb_ptz.ancien"), - cbind(aggregate(valeur~depcom+date,ptz[substr(ptz$variable,2,2)==2,],sum),variable="nb_ptz.neuf"), - cbind(aggregate(valeur~depcom+date,ptz[substr(ptz$variable,3,3)==2,],sum),variable="nb_ptz.locataire_autre"), - cbind(aggregate(valeur~depcom+date,ptz[substr(ptz$variable,3,3)==3,],sum),variable="nb_ptz.proprietaire_ou_autre"), - cbind(aggregate(valeur~depcom+date,ptz[substr(ptz$variable,3,3)==1,],sum),variable="nb_ptz.locataire_hlm")) %>% + cbind(aggregate(valeur~depcom+date,ptz[substr(ptz$variable,2,2)==2,],sum),variable="nb_ptz.neuf")) %>% # filter(date>=2008)%>% mutate(date=make_date(date,12,31))%>% mutate_if(is.character,as.factor) %>%