#---------------------------------------------------------------------------------------------------
# Histogramme : LAU2 2011 Europe populations et nombre d'entrées (racine carrée)------------------------------
Titre20 <- "Nombre de LAU selon leur densité de population"
SousTitre20 <- "Europe, 2011"
Titre_SousTitre20 <- paste0("<b>",Titre20,"</b>","<br>",SousTitre20)
TraView20<- ggplot(LAUdata2011, aes(x = DENS_2011,y = ..count..)) +
geom_histogram(fill="#ff1a75", bins =100)+
guides(x = guide_axis(angle = 90, n.dodge = 1))+
coord_cartesian(xlim = c(0, NA), ylim = c(1.2, NA))+
scale_x_sqrt (n.breaks = 20)+
scale_y_sqrt (n.breaks = 16)+
labs(
x = "Densité de population (hab/km2, échelle racine carrée)",
y = "Nombre (échelle racine carrée)",
title = Titre20,
subtitle = SousTitre20,
caption="Calculs: NLG. Source : Eurostat, LAU2",
color = "Variation annuelle \ndensité de population\n(1961-2011, hab/km2)")+
ThemeFunction
TraView20 <- AxesXY(TraView20)
TraView20
View(LAUdata2011)
## Diagramme de points : LAU2 2011 surfaces et population-----------------------
Titre21 <- "Relation entre surface de la commune et population"
SousTitre21 <- "Europe, 2011"
Titre_SousTitre21 <- paste0("<b>",Titre21,"</b>","<br>",SousTitre21)
TraView18<- ggplot(LAUdata2011)+
aes(x =AREA_KM2, y = POP_2011, color=DENS_2011)+
scale_color_viridis_c(option = "plasma", direction = 1) +
geom_point(size=2)+
scale_x_sqrt (n.breaks = 20)+
scale_y_sqrt (n.breaks = 20)+
guides(x = guide_axis(angle = 90, n.dodge = 1))+
labs(
x = "Surfaces (km2)",
y = "Population (hab)",
title = Titre21,
subtitle = SousTitre21,
caption="Calculs: NLG. Source : Eurostat, LAU2",
color = "Densité de population (hab/km2)")+
ThemeFunction2
TraView21 <- AxesXY(TraView18)
TraView21
TraView21plotly<- toWebGL(ggplotly(TraView21))%>%
ConfigPlotly1()%>%
layout(dragmode="pan",
title="<b>Relation entre surface de la commune et population</b>, Europe, 2011")
TraView21plotly
View(LAUdata2011)
View(LAUdata2011)
TraView18<- ggplot(LAUdata2011)+
aes(x =AREA_KM2, y = POP_2011, color=DENS_2011, label=LAU_NAME)+
scale_color_viridis_c(option = "plasma", direction = 1) +
geom_point(size=2)+
scale_x_sqrt (n.breaks = 20)+
scale_y_sqrt (n.breaks = 20)+
guides(x = guide_axis(angle = 90, n.dodge = 1))+
labs(
x = "Surfaces (km2)",
y = "Population (hab)",
title = Titre21,
subtitle = SousTitre21,
caption="Calculs: NLG. Source : Eurostat, LAU2",
color = "Densité de population (hab/km2)")+
ThemeFunction2
TraView21 <- AxesXY(TraView18)
TraView21
TraView21plotly<- toWebGL(ggplotly(TraView21))%>%
ConfigPlotly1()%>%
layout(dragmode="pan",
title="<b>Relation entre surface de la commune et population</b>, Europe, 2011")
TraView21plotly
#---------------------------------------------------------------------------------------------------
##LAU2 et TRADEVE-----------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
Titre23 <- "Relation entre surface de l'aire urbaine et population"
SousTitre23 <- "Europe, 2011, extrait"
Titre_SousTitre23<- paste0("<b>",Titre23,"</b>","<br>",SousTitre23)
ggplot(LAUTRA)+
aes(x =AREA_KM2, y = POP, color=DA2001-61)+
scale_color_viridis_c(option = "plasma", direction = 1) +
geom_point(size=2)+
geom_text(size=5, label=LAUdata2011$LAU_NAME,hjust = 0, nudge_x = 0.1)+
coord_cartesian(xlim = c(6, 24), ylim = c(75000, 155000))+
labs(
x = "Surfaces (km2, échelle racine carrée)",
y = "Population (hab, échelle racine carrée)",
title = Titre23,
subtitle = SousTitre23,
caption="Calculs: NLG. Source : Eurostat, LAU2",
color = "Densité de population")+
ThemeFunction2
# ## LAU_READ-----------------------------------------------------------------------------------------
# LAUT <- read_excel("./01-Input_data/LAU2_TEMP.xlsx",
#                       sheet = "LAU2_TEMP")
# LAUT2 <- filter(LAUT, CNTR_CODE=="HR")
#
# LAUT2$LAU2_ID2<-str_trunc(LAUT2$LAU2_ID, 5, side = c("left"), ellipsis = "")
#
# write.xlsx(LAUT2,file="LAUT2.xlsx", colNames = TRUE, sheetName="LAU_TEMP2",borders = "columns" )
# ##--------------------------------------------------------------------------------------------------
# ## LAU AND TRADEVE READ ----------------------------------------------------------------------------
LAUTRA <- read_excel("./01-Input_data/LAU_UMZ_FUSION_PT_UMZ.xlsx",
sheet = "LAU_UMZ_FUSION_PT_UMZ")
#---------------------------------------------------------------------------------------------------
##LAU2 et TRADEVE-----------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
Titre23 <- "Relation entre surface de l'aire urbaine et population"
SousTitre23 <- "Europe, 2011, extrait"
Titre_SousTitre23<- paste0("<b>",Titre23,"</b>","<br>",SousTitre23)
ggplot(LAUTRA)+
aes(x =AREA_KM2, y = POP, color=DA2001-61)+
scale_color_viridis_c(option = "plasma", direction = 1) +
geom_point(size=2)+
geom_text(size=5, label=LAUdata2011$LAU_NAME,hjust = 0, nudge_x = 0.1)+
coord_cartesian(xlim = c(6, 24), ylim = c(75000, 155000))+
labs(
x = "Surfaces (km2, échelle racine carrée)",
y = "Population (hab, échelle racine carrée)",
title = Titre23,
subtitle = SousTitre23,
caption="Calculs: NLG. Source : Eurostat, LAU2",
color = "Densité de population")+
ThemeFunction2
View(LAUTRA)
ggplot(LAUTRA)+
aes(x =AREA_KM2, y = POP, color=UMZ_DENS)+
scale_color_viridis_c(option = "plasma", direction = 1) +
geom_point(size=2)+
# geom_text(size=5, label=LAUdata2011$LAU_NAME,hjust = 0, nudge_x = 0.1)+
coord_cartesian(xlim = c(6, 24), ylim = c(75000, 155000))+
labs(
x = "Surfaces (km2, échelle racine carrée)",
y = "Population (hab, échelle racine carrée)",
title = Titre23,
subtitle = SousTitre23,
caption="Calculs: NLG. Source : Eurostat, LAU2",
color = "Densité de population")+
ThemeFunction2
ggplot(LAUTRA)+
aes(x =AREA_KM2, y = POP, color=DENS_KM2)+
scale_color_viridis_c(option = "plasma", direction = 1) +
geom_point(size=2)+
# geom_text(size=5, label=LAUdata2011$LAU_NAME,hjust = 0, nudge_x = 0.1)+
coord_cartesian(xlim = c(6, 24), ylim = c(75000, 155000))+
labs(
x = "Surfaces (km2, échelle racine carrée)",
y = "Population (hab, échelle racine carrée)",
title = Titre23,
subtitle = SousTitre23,
caption="Calculs: NLG. Source : Eurostat, LAU2",
color = "Densité de population")+
ThemeFunction2
ggplot(LAUTRA)+
aes(x =AREA_KM2, y = POP, color=UMZ_DENS)+
scale_color_viridis_c(option = "plasma", direction = 1) +
geom_point(size=2)+
# geom_text(size=5, label=LAUdata2011$LAU_NAME,hjust = 0, nudge_x = 0.1)+
coord_cartesian(xlim = c(6, 24), ylim = c(75000, 155000))+
labs(
x = "Surfaces (km2, échelle racine carrée)",
y = "Population (hab, échelle racine carrée)",
title = Titre23,
subtitle = SousTitre23,
caption="Calculs: NLG. Source : Eurostat, LAU2, Tradeve",
color = "Densité de population \nde l'aire urbaine")+
ThemeFunction2
#---------------------------------------------------------------------------------------------------
##LAU2 et TRADEVE-----------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
Titre25 <- "Relation entre surface de la commune et population"
SousTitre25 <- "Europe, aires urbaines Tradeve, 2011"
Titre_SousTitre25<- paste0("<b>",Titre25,"</b>","<br>",SousTitre25)
RechercherLau2011 <- highlight_key(LAUTRA, ~Nom, group ="<b>Sélectionner des communes urbaines européennes, 2011</b>")
#---------------------------------------------------------------------------------------------------
##LAU2 et TRADEVE-----------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
Titre25 <- "Relation entre surface de la commune et population"
SousTitre25 <- "Europe, aires urbaines Tradeve, 2011"
Titre_SousTitre25<- paste0("<b>",Titre25,"</b>","<br>",SousTitre25)
RechercherLau2011 <- highlight_key(LAUTRA, ~Nom, group ="<b>Sélectionner des communes urbaines européennes, 2011</b>")
Traview25<- ggplot(RechercherLau2011)+
aes(x =AREA_KM2, y = POP, color=UMZ_DENS, text=LAU_NAME, label=UMZ_NAME)+
scale_color_viridis_c(option = "plasma", direction = 1) +
geom_point(size=2)+
# geom_text(size=5, label=LAUdata2011$LAU_NAME,hjust = 0, nudge_x = 0.1)+
coord_cartesian(xlim = c(6, 24), ylim = c(75000, 155000))+
labs(
x = "Surfaces (km2, échelle racine carrée)",
y = "Population (hab, échelle racine carrée)",
title = Titre23,
subtitle = SousTitre23,
caption="Calculs: NLG. Source : Eurostat, LAU2, Tradeve",
color = "Densité de population \nde l'aire urbaine")+
ThemeFunction2
TraView25plotly<- withr::with_options(list(digits=3,scipen = 20),
toWebGL(ggplotly(TraView25,
tooltip = c("x", "y","text", "label"))))
TraView25plotly
TraView25plotly<-TraView52plotly%>%
highlight(on = "plotly_click",
selectize = TRUE,
persistent = TRUE,
dynamic = FALSE,
color = "#00A6A6",
opacityDim=0.1,
selected = s)
TraView25plotly<-TraView52plotly%>%
ConfigPlotly1()%>%
layout(dragmode="pan",
margin=list(t=100,
r=0,
b=150,
l=0),
title=list(text=Titre_SousTitre11,
xanchor='left',
yanchor='top'),
annotations = list(x = 1,
y = 0,
text = SourceTradeve,
showarrow = F,
xref='paper',
yref='paper',
xanchor='right',
yanchor='bottom',
yshift ='-90',
font=list(size=15)))
TraView52plotly
#---------------------------------------------------------------------------------------------------
##LAU2 et TRADEVE-----------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
Titre25 <- "Relation entre surface de la commune et population"
SousTitre25 <- "Europe, aires urbaines Tradeve, 2011"
Titre_SousTitre25<- paste0("<b>",Titre25,"</b>","<br>",SousTitre25)
RechercherLau2011 <- highlight_key(LAUTRA, ~LAU_NAME, group ="<b>Sélectionner des communes urbaines européennes, 2011</b>")
Traview25<- ggplot(RechercherLau2011)+
aes(x =AREA_KM2, y = POP, color=UMZ_DENS, text=LAU_NAME, label=UMZ_NAME)+
scale_color_viridis_c(option = "plasma", direction = 1) +
geom_point(size=2)+
# geom_text(size=5, label=LAUdata2011$LAU_NAME,hjust = 0, nudge_x = 0.1)+
coord_cartesian(xlim = c(6, 24), ylim = c(75000, 155000))+
labs(
x = "Surfaces (km2, échelle racine carrée)",
y = "Population (hab, échelle racine carrée)",
title = Titre23,
subtitle = SousTitre23,
caption="Calculs: NLG. Source : Eurostat, LAU2, Tradeve",
color = "Densité de population \nde l'aire urbaine")+
ThemeFunction2
TraView25plotly<- withr::with_options(list(digits=3,scipen = 20),
toWebGL(ggplotly(TraView25,
tooltip = c("x", "y","text", "label"))))
TraView25plotly
RechercherLau2011 <- highlight_key(LAUTRA, ~LAU_NAME, group ="<b>Sélectionner des communes urbaines européennes, 2011</b>")
Traview25<- ggplot(RechercherLau2011)+
aes(x =AREA_KM2, y = POP, color=UMZ_DENS, text=LAU_NAME, label=UMZ_NAME)+
scale_color_viridis_c(option = "plasma", direction = 1) +
geom_point(size=2)+
# geom_text(size=5, label=LAUdata2011$LAU_NAME,hjust = 0, nudge_x = 0.1)+
coord_cartesian(xlim = c(6, 24), ylim = c(75000, 155000))+
labs(
x = "Surfaces (km2, échelle racine carrée)",
y = "Population (hab, échelle racine carrée)",
title = Titre23,
subtitle = SousTitre23,
caption="Calculs: NLG. Source : Eurostat, LAU2, Tradeve",
color = "Densité de population \nde l'aire urbaine")+
ThemeFunction2
Traview25
TraView25plotly<- withr::with_options(list(digits=3,scipen = 20),
toWebGL(ggplotly(TraView25,
tooltip = c("x", "y","text", "label"))))
TraView25plotly<- withr::with_options(list(digits=3,scipen = 20),
ggplotly(Traview25,
tooltip = c("x", "y","text", "label")))
TraView25plotly
TraView25plotly<-TraView52plotly%>%
highlight(on = "plotly_click",
selectize = TRUE,
persistent = TRUE,
dynamic = FALSE,
color = "#00A6A6",
opacityDim=0.1,
selected = s)
TraView25plotly<-TraView25plotly%>%
highlight(on = "plotly_click",
selectize = TRUE,
persistent = TRUE,
dynamic = FALSE,
color = "#00A6A6",
opacityDim=0.1,
selected = s)
TraView25plotly<-TraView25plotly%>%
ConfigPlotly1()%>%
layout(dragmode="pan",
margin=list(t=100,
r=0,
b=150,
l=0),
title=list(text=Titre_SousTitre11,
xanchor='left',
yanchor='top'),
annotations = list(x = 1,
y = 0,
text = "Calculs: NLG. Source : Eurostat, LAU2, Tradeve",
showarrow = F,
xref='paper',
yref='paper',
xanchor='right',
yanchor='bottom',
yshift ='-90',
font=list(size=15)))
TraView25plotly<-TraView25plotly%>%
ConfigPlotly1()%>%
layout(dragmode="pan",
margin=list(t=100,
r=0,
b=150,
l=0),
title=list(text=Titre_SousTitre25,
xanchor='left',
yanchor='top'),
annotations = list(x = 1,
y = 0,
text = "Calculs: NLG. Source : Eurostat, LAU2, Tradeve",
showarrow = F,
xref='paper',
yref='paper',
xanchor='right',
yanchor='bottom',
yshift ='-90',
font=list(size=15)))
TraView52plotly
TraView25plotly<-TraView25plotly%>%
highlight(on = "plotly_click",
selectize = TRUE,
persistent = TRUE,
dynamic = FALSE,
color = "#00A6A6",
opacityDim=0.1,
selected = s)
# Produire le htmlwdiget avec plotly
s <- attrs_selected(
mode = "markers")
TraView25plotly<- withr::with_options(list(digits=3,scipen = 20),
ggplotly(Traview25,
tooltip = c("x", "y","text", "label")))
TraView25plotly
TraView25plotly<-TraView25plotly%>%
highlight(on = "plotly_click",
selectize = TRUE,
persistent = TRUE,
dynamic = FALSE,
color = "#00A6A6",
opacityDim=0.1,
selected = s)
TraView25plotly<-TraView25plotly%>%
ConfigPlotly1()%>%
layout(dragmode="pan",
margin=list(t=100,
r=0,
b=150,
l=0),
title=list(text=Titre_SousTitre25,
xanchor='left',
yanchor='top'),
annotations = list(x = 1,
y = 0,
text = "Calculs: NLG. Source : Eurostat, LAU2, Tradeve",
showarrow = F,
xref='paper',
yref='paper',
xanchor='right',
yanchor='bottom',
yshift ='-90',
font=list(size=15)))
TraView52plotly
TraView25plotly
# LTt1 <- read_excel("./01-Input_data/LAU_UMZ_FUSION_PT_Table1.xlsx",
#                      sheet = "LAU_UMZ_FUSION_PT_Table1")
#
# LTt2 <- read_excel("./01-Input_data/LAU_UMZ_FUSION_PT_Table2.xlsx",
#                    sheet = "LAU_UMZ_FUSION_PT_Table2")
#
# ## LAU AND TRADEVE FILTER 2011 ----------------------------------------------------------------------
names(LAUTRA)
str(LAUTRA)
typeof(LAUTRA$ID)
LT11 <- filter(LAUTRA, DATA_DATE==2011)
View(LT11)
LAUTRA <-LAUTRA %>%
select(1:31)
LT11 <- LAUTRA%>%
filter(DATA_DATE==2011)
#---------------------------------------------------------------------------------------------------
##LAU2 et TRADEVE-----------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
Titre25 <- "Relation entre surface de la commune et population"
SousTitre25 <- "Europe, aires urbaines Tradeve, 2011"
Titre_SousTitre25<- paste0("<b>",Titre25,"</b>","<br>",SousTitre25)
LAUTRA2011 <- LAUTRA%>%
filter(DATA_DATE==2011)
RechercherLau2011 <- highlight_key(LAUTRA2011, ~LAU_NAME, group ="<b>Sélectionner des communes urbaines européennes, 2011</b>")
Traview25<- ggplot(RechercherLau2011)+
aes(x =AREA_KM2, y = POP, color=UMZ_DENS, text=LAU_NAME, label=UMZ_NAME)+
scale_color_viridis_c(option = "plasma", direction = 1) +
geom_point(size=2)+
# geom_text(size=5, label=LAUdata2011$LAU_NAME,hjust = 0, nudge_x = 0.1)+
coord_cartesian(xlim = c(6, 24), ylim = c(75000, 155000))+
labs(
x = "Surfaces (km2, échelle racine carrée)",
y = "Population (hab, échelle racine carrée)",
title = Titre23,
subtitle = SousTitre23,
caption="Calculs: NLG. Source : Eurostat, LAU2, Tradeve",
color = "Densité de population \nde l'aire urbaine")+
ThemeFunction2
Traview25
# Produire le htmlwdiget avec plotly
s <- attrs_selected(
mode = "markers")
TraView25plotly<- withr::with_options(list(digits=3,scipen = 20),
ggplotly(Traview25,
tooltip = c("x", "y","text", "label")))
TraView25plotly
TraView25plotly<-TraView25plotly%>%
highlight(on = "plotly_click",
selectize = TRUE,
persistent = TRUE,
dynamic = FALSE,
color = "#00A6A6",
opacityDim=0.1,
selected = s)
TraView25plotly<-TraView25plotly%>%
ConfigPlotly1()%>%
layout(dragmode="pan",
margin=list(t=100,
r=0,
b=150,
l=0),
title=list(text=Titre_SousTitre25,
xanchor='left',
yanchor='top'),
annotations = list(x = 1,
y = 0,
text = "Calculs: NLG. Source : Eurostat, LAU2, Tradeve",
showarrow = F,
xref='paper',
yref='paper',
xanchor='right',
yanchor='bottom',
yshift ='-90',
font=list(size=15)))
TraView25plotly
#---------------------------------------------------------------------------------------------------
##LAU2 et TRADEVE-----------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
Titre25 <- "Relation entre surface de la commune et population"
SousTitre25 <- "Europe, aires urbaines Tradeve, 2011"
Titre_SousTitre25<- paste0("<b>",Titre25,"</b>","<br>",SousTitre25)
RechercherLau2011 <- highlight_key(LAUTRA2011, ~LAU_NAME, group ="<b>Sélectionner des communes urbaines européennes, 2011</b>")
Traview25<- ggplot(RechercherLau2011)+
aes(x =AREA_KM2, y = POP, color=UMZ_DENS, text=LAU_NAME, label=UMZ_NAME)+
scale_color_viridis_c(option = "plasma", direction = 1) +
geom_point(size=2)+
# geom_text(size=5, label=LAUdata2011$LAU_NAME,hjust = 0, nudge_x = 0.1)+
coord_cartesian(xlim = c(6, 24), ylim = c(75000, 200000))+
labs(
x = "Surfaces (km2, échelle racine carrée)",
y = "Population (hab, échelle racine carrée)",
title = Titre23,
subtitle = SousTitre23,
caption="Calculs: NLG. Source : Eurostat, LAU2, Tradeve",
color = "Densité de population \nde l'aire urbaine")+
ThemeFunction2
Traview25
# Produire le htmlwdiget avec plotly
s <- attrs_selected(
mode = "markers")
TraView25plotly<- withr::with_options(list(digits=3,scipen = 20),
ggplotly(Traview25,
tooltip = c("x", "y","text", "label")))
TraView25plotly
TraView25plotly<-TraView25plotly%>%
highlight(on = "plotly_click",
selectize = TRUE,
persistent = TRUE,
dynamic = FALSE,
color = "#00A6A6",
opacityDim=0.1,
selected = s)
TraView25plotly<-TraView25plotly%>%
ConfigPlotly1()%>%
layout(dragmode="pan",
margin=list(t=100,
r=0,
b=150,
l=0),
title=list(text=Titre_SousTitre25,
xanchor='left',
yanchor='top'),
annotations = list(x = 1,
y = 0,
text = "Calculs: NLG. Source : Eurostat, LAU2, Tradeve",
showarrow = F,
xref='paper',
yref='paper',
xanchor='right',
yanchor='bottom',
yshift ='-90',
font=list(size=15)))
TraView25plotly
