## Chargement des extensions -----------------------------------------------------------------------
library(tidyverse)
library(questionr)
library(readxl)
library(openxlsx)
library(foreign)
library(psych)
library(showtext)
library(shiny)
library(esquisse)
#Font add---------------
##font_add(family = "<DejaVuSans>", regular = "C:/Users/Citrouille/Documents/R/win-library/4.0/rgl/fonts/DejaVuSans.ttf", bold ="C:/Users/Citrouille/Documents/R/win-library/4.0/rgl/fonts/DejaVuSans-Bold.ttf", italic = "C:/Users/Citrouille/Documents/R/win-library/4.0/rgl/fonts/DejaVuSans-Oblique.ttf", bolditalic = "C:/Users/Citrouille/Documents/R/win-library/4.0/rgl/fonts/DejaVuSans-BoldOblique.ttf" )
##font_add(family = "<DejaVuSansCondensed>", regular = "C:/Users/Citrouille/Documents/R/win-library/4.0/rgl/fonts/DejaVuSansCondensed.ttf", bold ="C:/Users/Citrouille/Documents/R/win-library/4.0/rgl/fonts/DejaVuSansCondensed-Bold.ttf", italic = "C:/Users/Citrouille/Documents/R/win-library/4.0/rgl/fonts/DejaVuSansCondensed-Oblique.ttf", bolditalic = "C:/Users/Citrouille/Documents/R/win-library/4.0/rgl/fonts/DejaVuSansCondensed-BoldOblique.ttf" )
showtext_auto()
## Import des données et visualisations des données TRADEVE------------------------------------------------
Tradeve <- read_excel("M:/These/SIG/R_Analyse/Tradeve/INPUT/TRADEVE_UrbanAreas_Data.xlsx",
                          sheet = "UrbanAreas_Data") 
View(Tradeve)
## Réduction du nom de la table de données LAU -------------------------------------------------------
TRA <- Tradeve
View(TRA)
## Import des données et visualisations des données LAU------------------------------------------------
LAU11 <- read_excel("M:/These/SIG/R_Analyse/Tradeve/INPUT/LAU_RG_01M_2011.xlsx",
                      sheet = "LAU_RG_01M_2011_3035")
View(LAU11)
##Correlations entre surfaces et populations-------------------------------------------
wilcox.test(TRA_Pop$population ~ TRA_Area$surface,na.rm = TRUE)
##Calcul des augmentations annuelles de densités selon les périodes------------------
TRA$Dens_1961 <- TRA$Pop_1961/TRA$Area_1961
TRA$Dens_1971 <- TRA$Pop_1971/TRA$Area_1971
TRA$Dens_1981 <- TRA$Pop_1981/TRA$Area_1981
TRA$Dens_1991 <- TRA$Pop_1991/TRA$Area_1991
TRA$Dens_2001 <- TRA$Pop_2001/TRA$Area_2001
TRA$Dens_2011 <- TRA$Pop_2011/TRA$Area_2011
TRA$D2011_1961 <- TRA$Dens_2011-TRA$Dens_1961
TRA$D1999_1961 <- TRA$Dens_1999-TRA$Dens_1961
TRA$D2011_2001 <- TRA$Dens_2011-TRA$Dens_2001
TRA$DA2001_1961 <- TRA$D2001_1961/(2001-1961)
TRA$DA2011_2001 <- TRA$D2011_2001/(2011-2001)
TRA$DA2011_1961 <- TRA$D2011_1961/(2011-1961)
View(TRA)
##Examiner le jeu de données-----------------------------------------------------------------------
str(TRA)
typeof(TRA$Pop_1961)
class(TRA$Pop_1961)
nrow(TRA)
ncol(TRA)
dim(TRA)
names(TRA)
##Organiser et nettoyer les données----------------------------------------------------------------------------
TRA_Pop <- TRA%>%select(Unit_Code_Ori,Unit_Code_Retro,Name,Country,Pop_1961,Pop_1971,Pop_1981,Pop_1991,Pop_2001,Pop_2011) %>%
  rename('1961'=Pop_1961,'1971'=Pop_1971,'1981'=Pop_1981,'1991'=Pop_1991,'2001'=Pop_2001,'2011'=Pop_2011) %>%
  pivot_longer(c('1961', '1971','1981','1991','2001','2011'),names_to = "annee", values_to = "population")
View(TRA_Pop)
TRA_Area<-TRA %>% 
  select(Unit_Code_Ori,Unit_Code_Retro,Name,Country,Area_1961,Area_1971,Area_1981,Area_1991,Area_2001,Area_2011)%>% 
  rename('1961'=Area_1961,'1971'=Area_1971,'1981'=Area_1981,'1991'=Area_1991,'2001'=Area_2001,'2011'=Area_2011)%>% 
  pivot_longer(c('1961', '1971','1981','1991','2001','2011'),names_to = "annee", values_to = "surface") %>% 
  filter(surface > 0)
view(TRA_Area)
TRA_Dens<-TRA %>% 
  select(Unit_Code_Ori,Unit_Code_Retro,Name,Country,Dens_1961,Dens_1971,Dens_1981,Dens_1991,Dens_2001,Dens_2011)%>% 
  rename('1961'=Dens_1961,'1971'=Dens_1971,'1981'=Dens_1981,'1991'=Dens_1991,'2001'=Dens_2001,'2011'=Dens_2011)%>% 
  pivot_longer(c('1961', '1971','1981','1991','2001','2011'),names_to = "annee", values_to = "densite") %>% 
  filter(densite > 0)
view(TRA_Dens)
## Statistiques de base, exportables (dyplr)---------------------------------------------------
SUM_TRA_Pop<-TRA_Pop %>%
  group_by(annee)%>%
  summarise ('min' = min (population, na.rm = TRUE),
             '1er quantile'= quantile (population, prob = 0.25, na.rm = TRUE),
             'mediane'= median (population, na.rm = TRUE),
             '3e quantile'= quantile (population, prob = 0.75, na.rm = TRUE),
             'max'= max (population, na.rm = TRUE),
             'moyenne'= mean(population, na.rm = TRUE))
write.xlsx(SUM_TRA_Pop,file="SUM_TRA_Pop.xlsx", colNames = TRUE, sheetName="Population",borders = "columns" )
SUM_TRA_Area<-TRA_Area%>%
  group_by(annee)%>%
  summarise ('min' = min (surface, na.rm = TRUE),
             '1er quantile'= quantile (surface,0.25, na.rm = TRUE),
             'mediane'= median (surface, na.rm = TRUE),
             '3e quantile'= quantile (surface,0.75, na.rm = TRUE),
             'max'= max (surface, na.rm = TRUE),
             'moyenne'= mean(surface, na.rm = TRUE))
write.xlsx(SUM_TRA_Area,file="SUM_TRA_Area.xlsx", colNames = TRUE, sheetName="Surface",borders = "columns" )
SUM_TRA_Dens<-TRA_Dens %>%
  group_by(annee)%>%
  summarise ('min' = min (densite, na.rm = TRUE),
             '1er quantile'= quantile (densite, prob = 0.25, na.rm = TRUE),
             'mediane'= median (densite, na.rm = TRUE),
             '3e quantile'= quantile (densite, prob = 0.75, na.rm = TRUE),
             'max'= max (densite, na.rm = TRUE),
             'moyenne'= mean(densite, na.rm = TRUE))
write.xlsx(SUM_TRA_Dens,file="SUM_TRA_Dens.xlsx", colNames = TRUE, sheetName="Densite",borders = "columns" )
##--------------------------------------------------------------------------------------------------
##LAU Préparation Croatie---------------------------------------------------------------------------
## LAU_READ-----------------------------------------------------------------------------------------
LAUT <- read_excel("M:/These/SIG/R_Analyse/Tradeve/INPUT/LAU2_TEMP.xlsx",
                      sheet = "LAU2_TEMP")
View(LAUT)
LAUT2 <- filter(LAUT, CNTR_CODE=="HR")
View(LAUT2)
LAUT2$LAU2_ID2<-str_trunc(LAUT2$LAU2_ID, 5, side = c("left"), ellipsis = "")
View(LAUT2)
write.xlsx(LAUT2,file="LAUT2.xlsx", colNames = TRUE, sheetName="LAU_TEMP2",borders = "columns" )
##--------------------------------------------------------------------------------------------------
## LAU AND TRADEVE READ ----------------------------------------------------------------------------
LAUTRA <- read_excel("M:/These/SIG/R_Analyse/Tradeve/INPUT/LAU_UMZ_FUSION_PT_UMZ.xlsx",
                   sheet = "LAU_UMZ_FUSION_PT_UMZ")
View(LAUTRA)
LTt1 <- read_excel("M:/These/SIG/R_Analyse/Tradeve/INPUT/LAU_UMZ_FUSION_PT_Table1.xlsx",
                     sheet = "LAU_UMZ_FUSION_PT_Table1")
View(LTt1)
LTt2 <- read_excel("M:/These/SIG/R_Analyse/Tradeve/INPUT/LAU_UMZ_FUSION_PT_Table2.xlsx",
                   sheet = "LAU_UMZ_FUSION_PT_Table2")
View(LTt2)
## LAU AND TRADEVE FILTER 2011 ----------------------------------------------------------------------
names(LAUTRA)
str(LAUTRA)
typeof(LAUTRA$ID)
LT11 <- filter(LAUTRA, DATA_DATE==2011)
View(LT11)
##TRADEVE AIRES URBAINES----------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
## Histogramme : Tradeve Europe surfaces et nombre d'entrées en 1961 (racine carrée)------------------------------
ggplot(TRA, aes(x = Area_1961,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 = "Surfaces (km2, échelle racine carrée)",
    y = "Nombre (échelle racine carrée)",
    title = "Nombre d'aires urbaines selon leurs surfaces",
    subtitle = "Europe, 1961",
    caption="Calculs: NLG. Source : Tradeve database",
    color = "Variation annuelle dens. pop. (1961-2011)")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_blank(),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        plot.caption = element_text(size = 10, face="plain"))
## Histogramme : Tradeve Europe populations 1961 et 2011, nombre d'entrées (racine carrée)------------------------------
TRA_Pop2 <- filter(TRA_Pop, annee=="1961"| annee=="2011")
ggplot(TRA_Pop2, aes(x=population,color=annee)) +
  geom_histogram(fill="white", bins =100, alpha=0, position="identity", size=1)+
  coord_cartesian(xlim = c(0, NA), ylim = c(2, NA))+
  scale_color_manual(values = c(`1961` = "#FF1A75",`2011` = "#00A6A6")) +
  guides(x = guide_axis(angle = 90, n.dodge = 1))+
  scale_x_sqrt (n.breaks = 20)+
  scale_y_sqrt (n.breaks = 20)+
  labs(
    x = "Population (échelle racine carrée)",
    y = "Nombre (échelle racine carrée)",
    title = "Nombre d'aires urbaines selon leurs populations",
    subtitle = "Europe, entre 1961 et 2011",
    caption="Calculs : NLG. Source : Tradeve database",
    color = "Années")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.98, .98),
        legend.justification = c("right", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain"))
## Histogramme : Tradeve Europe surfaces 1961 et 2011, nombre d'entrées (racine carrée)------------------------------
TRA_Area2 <- filter(TRA_Area, annee=="1961"| annee=="2011")
ggplot(TRA_Area2, aes(x=surface,color=annee)) +
  geom_histogram(fill="white", bins =100, alpha=0, position="identity", size=1)+
  scale_color_manual(values = c(`1961` = "#FF1A75",`2011` = "#00A6A6")) +
  coord_cartesian(xlim = c(0, NA), ylim = c(1, NA))+
  guides(x = guide_axis(angle = 90, n.dodge = 1))+
  scale_x_sqrt (n.breaks = 20)+
  scale_y_sqrt (n.breaks = 16)+
  labs(
    x = "Surface (km2, échelle racine carrée)",
    y = "Nombre (échelle racine carrée)",
    title = "Nombre d'aires urbaines selon leurs surfaces",
    subtitle = "Europe, entre 1961 et 2011",
    caption="Calculs : NLG. Source : Tradeve database",
    color = "Années")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.98, .98),
        legend.justification = c("right", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain"))
## -------------------------------------------------------------------------------------------------
## Histogramme : Tradeve Europe densité de population 1961 et 2011, nombre d'entrées (racine carrée)------------------------------
TRA_Dens2 <- filter(TRA_Dens, annee=="1961"| annee=="2011")
ggplot(TRA_Dens2, aes(x=densite,color=annee)) +
  geom_histogram(fill="white", bins =100, alpha=0, position="identity", size=1)+
  scale_color_manual(values = c(`1961` = "#FF1A75",`2011` = "#00A6A6")) +
  coord_cartesian(xlim = c(0, NA), ylim = c(0.3, NA))+
  guides(x = guide_axis(angle = 90, n.dodge = 1))+
  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 = "Nombre d'aires urbaines selon leurs densités de population",
    subtitle = "Europe, entre 1961 et 2011",
    caption="Calculs : NLG. Source : Tradeve database",
    color = "Années")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.98, .98),
        legend.justification = c("right", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain"))
## -------------------------------------------------------------------------------------------------
## Histogramme : Tradeve Europe populations et nombre d'entrées (racine carrée) avec valeur médiane------------------------------
TRA_H <- ggplot(TRA, aes(x = Pop_2011,y = ..count..)) +
  geom_histogram(fill="#ff1a75", bins =20)+
  guides(x = guide_axis(angle = 90, n.dodge = 1))+
  coord_cartesian(xlim = c(0, NA), ylim = c(5, 3100))+
  scale_x_sqrt (n.breaks = 20)+
  scale_y_sqrt (n.breaks = 20)+
  labs(
    x = "Population (échelle racine carrée)",
    y = "Nombre (échelle racine carrée)",
    title = "Nombre d'aires urbaines selon leurs surfaces",
    subtitle = "Europe, 2011",
    caption="Source : Tradeve database",
    color = "Variation annuelle dens. pop. (1961-2011)")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_blank(),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        plot.caption = element_text(size = 10, face="plain"))
TRA_H+ geom_vline(aes(xintercept=median(TRA$Pop_2011, na.rm = TRUE)), linetype="dashed", color="#00a6a6", size=1)
## Histogramme : Tradeve France populations 1961 et 2011, nombre d'entrées (racine carrée)------------------------------
TRA_PopF <- filter(TRA_Pop, annee=="1961"& Country == "FR"| annee=="2011" & Country == "FR")
ggplot(TRA_PopF, aes(x=population,color=annee)) +
  geom_histogram(fill="white", bins =100, alpha=0, position="identity", size=1)+
  scale_color_manual(values = c(`1961` = "#FF1A75",`2011` = "#00A6A6")) +
  coord_cartesian(xlim = c(0, NA), ylim = c(0.2, NA))+
  guides(x = guide_axis(angle = 90, n.dodge = 1))+
  scale_x_sqrt (n.breaks = 20)+
  scale_y_sqrt (n.breaks = 32)+
  labs(
    x = "Population (échelle racine carrée)",
    y = "Nombre (échelle racine carrée)",
    title = "Nombre d'aires urbaines selon leurs populations",
    subtitle = "France, entre 1961 et 2011",
    caption="Calculs: NLG. Source : Tradeve database",
    color = "Années")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.98, .98),
        legend.justification = c("right", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain") )
## Histogramme : Tradeve France surfaces 1961 et 2011, nombre d'entrées (racine carrée)------------------------------
TRA_AreaF <- filter(TRA_Area, annee=="1961"& Country == "FR"| annee=="2011" & Country == "FR")
TRA_AreaFp<- ggplot(TRA_AreaF, aes(x=surface,color=annee)) +
  geom_histogram(fill="white", bins =100, alpha=0, position="identity", size=1)+
  scale_color_manual(values = c(`1961` = "#FF1A75",`2011` = "#00A6A6")) +
  coord_cartesian(xlim = c(0, NA), ylim = c(0.06, NA))+
  guides(x = guide_axis(angle = 90, n.dodge = 1))+
  scale_x_sqrt (n.breaks = 40)+
  scale_y_sqrt (n.breaks = 32)+
  labs(
    x = "Surface (km2, échelle racine carrée)",
    y = "Nombre (échelle racine carrée)",
    title = "Nombre d'aires urbaines selon leurs surfaces",
    subtitle = "France, entre 1961 et 2011",
    caption="Calculs: NLG. Source : Tradeve database",
    color = "Années")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.98, .98),
        legend.justification = c("right", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain") )
TRA_AreaFp + geom_vline (aes(xintercept=median(TRA$Area_2011), xintercept=median(TRA$Area_1961),  na.rm = TRUE), linetype="dashed", color="#00a6a6", size=1)
## Histogramme : Tradeve augmentation de la densité de population (1961-2011) et nombre d'entrées (racine carrée)------------------------------
TRAV_DA<- ggplot(TRA, aes(x = DA2011_1961,y = ..count..)) + 
  geom_histogram(fill="#ff1a75", bins =100)+
  coord_cartesian(xlim = c(-75, 125), ylim = c(1.5, NA))+
  scale_y_sqrt (n.breaks = 40)+
  scale_x_continuous (n.breaks = 10)+
  guides(x = guide_axis(angle = 90, n.dodge = 1))+
  labs(
    x = "Augmentation annuelle de la densité de population (hab/km2) entre 1961 et 2011",
    y = "Nombre (échelle racine carrée)",
    title = "Nombre d'aires urbaines selon l'augmentation annuelle de leur densité de population",
    subtitle = "Europe, entre 1961 et 2011",
    caption="Calculs: NLG. Source : Tradeve database",
    color = "Variation annuelle dens. pop. (1961-2011)")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_blank(),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        plot.caption = element_text(size = 10, face="plain"))
TRAV_DA+ geom_vline(aes(xintercept=median(DA2011_1961,na.rm = TRUE)), linetype="dashed", color="#00a6a6", size=1)
## Diagramme de points : Tradeve surfaces et augmentation de la densité de population (racine carrée) -----------------------
TRA_DA<- ggplot(TRA)+
  aes(x =Area_1961,y = DA2011_1961)+ 
  geom_point(color="#ff1a75",alpha=0.5, size=5)+
  scale_x_sqrt (n.breaks = 40)+
  scale_y_continuous (n.breaks = 20)+
  guides(x = guide_axis(angle = 90, n.dodge = 1))+
  labs(
    x = "Surfaces en 1961 (km2, échelle racine carrée)",
    y = "Augmentation annuelle de la densité de population (hab/km2) entre 1961 et 2011",
    title = "Relation entre surface de l'aire urbaine et variation de la densité de population",
    subtitle = "Europe, entre 1961 et 2011",
    caption="Calculs: NLG. Source : Tradeve database",
    color = "Variation annuelle dens. pop. (1961-2011)")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.98, .98),
        legend.justification = c("right", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain"))
TRA_DA+ geom_vline(aes(xintercept=0), linetype="dashed", color="black", size=1)+ geom_hline(aes(yintercept=0), linetype="dashed", color="black", size=1)
## Diagramme de points : Tradeve population et augmentation de la densité de population (racine carrée) -----------------------
TRA_DA<- ggplot(TRA)+
  aes(x =Pop_1961,y = DA2011_1961)+ 
  geom_point(color="#ff1a75",alpha=0.5, size=5)+
  scale_x_sqrt (n.breaks = 20)+
  scale_y_continuous (n.breaks = 20)+
  guides(x = guide_axis(angle = 90, n.dodge = 1))+
  labs(
    x = "Population en 1961 (km2, échelle racine carrée)",
    y = "Augmentation annuelle de la densité de population (hab/km2, 1961-2011)",
    title = "Relation entre population de l'aire urbaine et variation de la densité de population",
    subtitle = "Europe, entre 1961 et 2011",
    caption="Calculs: NLG. Source : Tradeve database",
    color = "Variation annuelle dens. pop. (1961-2011)")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.98, .98),
        legend.justification = c("right", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain"))
TRA_DA+ geom_vline(aes(xintercept=0), linetype="dashed", color="black", size=1)+ geom_hline(aes(yintercept=0), linetype="dashed", color="black", size=1)
## Diagramme de points : Tradeve surfaces et population(racine carrée, couleur densité) -----------------------
ggplot(TRA)+
  aes(x =Area_2011,y = Pop_2011,colour = DA2011_1961)+ 
  geom_point(size=5)+
  scale_color_viridis_c(option = "plasma", direction = 1) +
  scale_x_sqrt (n.breaks = 20)+
  scale_y_sqrt (n.breaks = 20)+
  guides(x = guide_axis(angle = 90, n.dodge = 1))+
  labs(
    x = "Surfaces en 2011 (km2, échelle racine carrée)",
    y = "Population en 2011 (km2, échelle racine carrée)",
    title = "Relation entre surface de l'aire urbaine et population",
    subtitle = "Europe, 2011",
    caption="Calculs: NLG. Source : Tradeve database",
    color = "Variation annuelle dens. pop. (1961-2011)")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.98, .98),
        legend.justification = c("right", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain"))
## Diagramme de textes : Tradeve surfaces et population(racine carrée, couleur densité) 2011-----------------------
ggplot(TRA)+
  aes(x =Area_2011,y = Pop_2011, colour = DA2011_1961)+
  scale_color_viridis_c(option = "plasma", direction = 1) +
  geom_text(size=5, label=TRA$Name,,hjust = 0, nudge_x = 0.2)+
  coord_cartesian(xlim = c(0, 23000), ylim = c(0, 11000000))+
  scale_x_sqrt (n.breaks = 20)+
  scale_y_sqrt (n.breaks = 20)+
  guides(x = guide_axis(angle = 90, n.dodge = 1))+
  labs(
    x = "Surfaces en 2011 (km2, échelle racine carrée)",
    y = "Population en 2011 (km2, échelle racine carrée)",
    title = "Relation entre surface de l'aire urbaine et population",
    subtitle = "Europe, 2011",
    caption="Calculs: NLG. Source : Tradeve database",
    color = "Variation annuelle dens. pop. (1961-2011)")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.98, .98),
        legend.justification = c("right", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain"))
## Diagramme de textes : Tradeve surfaces et population(racine carrée, couleur densité) 1961-----------------------
ggplot(TRA)+
  aes(x =Area_1961,y = Pop_1961, colour = DA2011_1961)+
  scale_color_viridis_c(option = "plasma", direction = 1) +
  geom_text(size=5, label=TRA$Name,,hjust = 0, nudge_x = 0.2)+
  coord_cartesian(xlim = c(0, 23000), ylim = c(0, 11000000))+
  scale_x_sqrt (n.breaks = 20)+
  scale_y_sqrt (n.breaks = 20)+
  guides(x = guide_axis(angle = 90, n.dodge = 1))+
  labs(
    x = "Surfaces en 1961 (km2, échelle racine carrée)",
    y = "Population en 1961 (km2, échelle racine carrée)",
    title = "Relation entre surface de l'aire urbaine et population",
    subtitle = "Europe, 1961",
    caption="Calculs: NLG. Source : Tradeve database",
    color = "Variation annuelle dens. pop. (1961-2011)")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.98, .98),
        legend.justification = c("right", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain"))
## Diagramme de points : Tradeve surfaces et population,(racine carrée) -----------------------
ggplot(TRA, aes(y = Pop_1961,x =Area_1961))+ 
  geom_point(color="#ff1a75",alpha=0.3, size=7)+
  scale_x_sqrt (n.breaks = 20)+
  scale_y_sqrt (n.breaks = 20)+
  labs(
    x = "Surfaces (km2, échelle racine carrée)",
    y = "Population (km2, échelle racine carrée)",
    title = "Relation entre surface de l'aire urbaine et population",
    subtitle = "Europe, 1961",
    caption="Calculs: NLG. Source : Tradeve database",
    color = "Variation annuelle dens. pop. (1961-2011)")+
  guides(x = guide_axis(angle = 90, n.dodge = 1))+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        plot.caption = element_text(size = 10, face="plain"))
## Diagramme de points hex : Tradeve surfaces et population,(racine carrée) -----------------------
ggplot(TRA, aes(y = Pop_1961,x =Area_1961))+ 
  geom_hex()+
  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, échelle racine carrée)",
    y = "Population (km2, échelle racine carrée)",
    title = "Relation entre surface de l'aire urbaine et population",
    subtitle = "Europe, 1961",
    caption="Calculs: NLG. Source : Tradeve database",
    color = "Variation annuelle dens. pop. (1961-2011)")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        plot.caption = element_text(size = 10, face="plain"))
## Diagramme de points/textes : Tradeve surfaces et population, 1961, zoom-----------------------
ggplot(TRA)+
  aes(x =Area_1961,y = Pop_1961, colour = DA2011_1961)+ 
  scale_color_viridis_c(option = "plasma", direction = 1) +
  geom_point(size=2)+
  geom_text(size=5, label=TRA$Name,,hjust = 0, nudge_x = 10)+
  coord_cartesian(xlim = c(200, 1600), ylim = c(800000, 1700000))+
  labs(
    x = "Surfaces (km2, échelle racine carrée)",
    y = "Population (km2, échelle racine carrée)",
    title = "Relation entre surface de l'aire urbaine et population",
    subtitle = "Europe, 1961, extrait",
    caption="Calculs: NLG. Source : Tradeve database",
    color = "Variation annuelle dens. pop. (1961-2011)")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.02, .98),
        legend.justification = c("left", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain"))
## Diagramme de points/textes : Tradeve surfaces et population, 2011, zoom -----------------------
ggplot(TRA)+
  aes(x =Area_2011,y = Pop_2011, colour = DA2011_1961)+
  scale_color_viridis_c(option = "plasma", direction = 1) +
  geom_point(size=2)+
  geom_text(size=5, label=TRA$Name,,hjust = 0, nudge_x = 10)+
  coord_cartesian(xlim = c(200, 1600), ylim = c(800000, 1700000))+
  labs(
    x = "Surfaces (km2, échelle racine carrée)",
    y = "Population (km2, échelle racine carrée)",
    title = "Relation entre surface de l'aire urbaine et population",
    subtitle = "Europe, 2011, extrait",
    caption="Calculs: NLG. Source : Tradeve database",
    color = "Variation annuelle dens. pop. (1961-2011)")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.02, .98),
        legend.justification = c("left", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain"))
##--------------------------------------------------------------------------------------------------
##LAU 2---------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
# Histogramme : LAU2 2011 Europe populations et nombre d'entrées (racine carrée)------------------------------
ggplot(LAU11, aes(x = POP_DENS_2,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 = "Nombre de LAU selon leur densité de population",
    subtitle = "Europe, 2011",
    caption="Calculs: NLG. Source : Eurostat, LAU2",
    color = "Variation annuelle dens. pop. (1961-2011)")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_blank(),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        plot.caption = element_text(size = 10, face="plain"))
## Diagramme de points : LAU2 2011 surfaces et population-----------------------
ggplot(LAU11)+
  aes(x =AREA_KM2, y = POP_2011, color=POP_DENS_2)+
  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 = "Relation entre surface de l'aire urbaine et population",
    subtitle = "Europe, 2011",
    caption="Calculs: NLG. Source : Eurostat, LAU2",
    color = "Densité de population (hab/km2)")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.98, .98),
        legend.justification = c("right", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain"))
## Diagramme de textes : LAU2 2011 surfaces et population, zoom large-----------------------
ggplot(LAU11)+
  aes(x =AREA_KM2, y = POP_2011, color=POP_DENS_2)+
  scale_color_viridis_c(option = "plasma", direction = 1) +
  geom_text(size=4, label=LAU11$LAU_NAME,hjust = 0, nudge_x = 0.1)+
  coord_cartesian(xlim = c(0, 30), ylim = c(60000, NA))+
  labs(
    x = "Surfaces (km2)",
    y = "Population (hab)",
    title = "Relation entre surface de l'aire urbaine et population",
    subtitle = "Europe, 2011, extrait",
    caption="Calculs: NLG. Source : Eurostat, LAU2",
    color = "Densité de population (hab/km2)")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.02, .98),
        legend.justification = c("left", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain"))
## Diagramme de points/textes : LAU2 2011 surfaces et population, zoom moyen-----------------------
ggplot(LAU11)+
  aes(x =AREA_KM2, y = POP_2011, color=POP_DENS_2)+
  scale_color_viridis_c(option = "plasma", direction = 1) +
  geom_point(size=2)+
  geom_text(size=5, label=LAU11$LAU_NAME,hjust = 0, nudge_x = 0.1)+
  coord_cartesian(xlim = c(0, 30), ylim = c(60000, 300000))+
  labs(
    x = "Surfaces (km2)",
    y = "Population (hab)",
    title = "Relation entre surface de l'aire urbaine et population",
    subtitle = "Europe, 2011, extrait",
    caption="Calculs: NLG. Source : Eurostat, LAU2",
    color = "Densité de population (hab/km2)")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.02, .98),
        legend.justification = c("left", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain"))
## Diagramme de points/textes : LAU2 2011 surfaces et population, 2011, zoom -----------------------
ggplot(LAU11)+
  aes(x =AREA_KM2, y = POP_2011, color=POP_DENS_2)+
  scale_color_viridis_c(option = "plasma", direction = 1) +
  geom_point(size=2)+
  geom_text(size=5, label=LAU11$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 (km2, échelle racine carrée)",
    title = "Relation entre surface de l'aire urbaine et population",
    subtitle = "Europe, 2011, extrait",
    caption="Calculs: NLG. Source : Eurostat, LAU2",
    color = "Densité de population")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.02, .98),
        legend.justification = c("left", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain"))
#---------------------------------------------------------------------------------------------------
##LAU2 et TRADEVE-----------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
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=LAU11$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 (km2, échelle racine carrée)",
    title = "Relation entre surface de l'aire urbaine et population",
    subtitle = "Europe, 2011, extrait",
    caption="Calculs: NLG. Source : Eurostat, LAU2",
    color = "Densité de population")+
  theme_light(base_family = "DejaVuSansCondensed")+
  theme(plot.margin=margin(18,12,18,12,"pt"),
        plot.title =element_text(face="bold",lineheight = 1.5),
        panel.border = element_rect(fill = NA, colour = "grey",size = 0.1,linetype = "solid"),
        panel.spacing = unit(1,"lines"),
        panel.grid.minor = element_line(linetype = "dotted", size=0.2),
        title = element_text(face = "bold", size=14),
        strip.text.x = element_text(face = "bold", size=12),
        axis.title=element_text(face = "bold", size=12),
        axis.text =element_text(size = rel(0.7), lineheight = 2),
        legend.title =element_text(face = "bold", size=12),
        legend.position = c(.02, .98),
        legend.justification = c("left", "top"),
        legend.box.just = "right",
        plot.caption = element_text(size = 10, face="plain"))
#---------------------------------------------------------------------------------------------------
##PLOT_SAVE-----------------------------------------------------------------------------------------
ggsave("Rplot%02d_1240.png",
       plot = last_plot(),
       width = 1240,
       height = 1240,
       units = c("px"),
       dpi = 72
)
ggsave("Rplot%02d_1240.tiff",
       plot = last_plot(),
       width = 1240,
       height = 1240,
       units = c("px"),
       dpi = 72
)

