Code
load_data("insee/filosofi2015_var.RData")
load_data("insee/filosofi2015_COM.RData")
load_data("insee/filosofi2015_DEP.RData")
load_data("maps/france.RData")
load_data("maps/communes.RData")
load_data("maps/communes_details.RData")
Data - INSEE
load_data("insee/filosofi2015_var.RData")
load_data("insee/filosofi2015_COM.RData")
load_data("insee/filosofi2015_DEP.RData")
load_data("maps/france.RData")
load_data("maps/communes.RData")
load_data("maps/communes_details.RData")
%>%
filosofi2015_var select(1, 2) %>%
if (is_html_output()) datatable(., filter = 'top', rownames = F) else .} {
%>%
filosofi2015_COM rename(INSEE_COM = CODGEO) %>%
filter(variable == "MED15") %>%
left_join(communes, by = "INSEE_COM") %>%
left_join(communes_details, by = "INSEE_COM") %>%
filter(CODE_DEPT == "92") %>%
ggplot(.) + aes(long, lat, group = group, fill = value) + coord_equal() +
theme_void() + labs(fill = "Revenu médian") + geom_polygon() +
geom_polygon(colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white",
labels = dollar_format(a = 1, p = "", su = "€"))
%>%
filosofi2015_COM rename(INSEE_COM = CODGEO) %>%
filter(variable == "RD15") %>%
left_join(communes, by = "INSEE_COM") %>%
left_join(communes_details, by = "INSEE_COM") %>%
filter(CODE_DEPT %in% c("92", "93", "94")) %>%
ggplot(.) + aes(long, lat, group = group, fill = value) +
theme_void() + labs(fill = "Rapport interdécile") +
geom_polygon(colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white") + coord_equal()
%>%
filosofi2015_COM rename(INSEE_COM = CODGEO) %>%
filter(variable == "MED15") %>%
left_join(communes, by = "INSEE_COM") %>%
left_join(communes_details, by = "INSEE_COM") %>%
filter(CODE_DEPT %in% c("75")) %>%
ggplot(.) + aes(long, lat, group = group, fill = value) +
theme_void() + labs(fill = "Revenu médian") + coord_equal() +
geom_polygon(colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white",
labels = dollar_format(a = 1, p = "", su = "€"))
%>%
filosofi2015_DEP filter(variable == "MED15") %>%
rename(depts_code = CODGEO) %>%
select(depts_code, value) %>%
right_join(france, by = "depts_code") %>%
ggplot(aes(long, lat, group = group, fill = value)) +
geom_polygon() + coord_map() +
scale_fill_viridis_c(na.value = "white",
labels = dollar_format(a = 1, p = "", su = "€"),
name = "Revenu médian") +
labs(x = "", y = "") +
theme_minimal() + theme(axis.text.x = element_blank(),
axis.text.y = element_blank())
%>%
filosofi2015_DEP filter(variable == "MED15",
%in% c("75", "92", "93", "94")) %>%
CODGEO rename(depts_code = CODGEO) %>%
select(depts_code, value) %>%
left_join(france, by = "depts_code") %>%
ggplot(.) + aes(long, lat, group = group, fill = value) +
theme_void() + labs(fill = "Rapport interdécile") +
geom_polygon(colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white",
labels = dollar_format(a = 1, p = "", su = "€"),
name = "Revenu médian") +
labs(x = "", y = "") +
coord_equal()
%>%
filosofi2015_COM rename(INSEE_COM = CODGEO) %>%
filter(variable == "MED15") %>%
left_join(communes, by = "INSEE_COM") %>%
left_join(communes_details, by = "INSEE_COM") %>%
filter(CODE_DEPT %in% c("75", "92", "93", "94")) %>%
ggplot(.) + aes(long, lat, group = group, fill = value) + coord_equal() +
theme_void() + labs(fill = "Revenu médian") + geom_polygon() +
geom_polygon(colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white",
labels = dollar_format(a = 1, p = "", su = "€"))