presidentielles_2002 %>%
filter(tour == 1) %>%
mutate(depts_code = substr(INSEE_COM, 1, 2)) %>%
group_by(depts_code) %>%
summarise(value = sum(nb_voix[nom == "CHEVENEMENT"]) / sum(nb_voix)) %>%
right_join(france, by = "depts_code") %>%
ggplot(.) + aes(long, lat, group = group) + theme_void() + coord_map() +
geom_polygon(aes(fill = value), colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white",
name = "Chevènement T1",
labels = scales::percent_format(accuracy = 1))
presidentielles_2002 %>%
filter(tour == 1) %>%
group_by(INSEE_COM) %>%
summarise(value = sum(nb_voix[nom == "CHEVENEMENT"]) / sum(nb_voix)) %>%
left_join(communes, by = "INSEE_COM") %>%
left_join(communes_details, by = "INSEE_COM") %>%
filter(CODE_DEPT %in% c("92")) %>%
ggplot(.) + aes(long, lat, group = group) + theme_void() + coord_equal() +
geom_polygon(aes(fill = value), colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white",
name = "Chevènement T1",
labels = scales::percent_format(accuracy = 1))
presidentielles_2002 %>%
filter(tour == 1) %>%
group_by(INSEE_COM) %>%
summarise(value = sum(nb_voix[nom == "CHEVENEMENT"]) / sum(nb_voix)) %>%
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) + theme_void() + coord_equal() +
geom_polygon(aes(fill = value), colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white",
name = "Chevènement T1",
labels = scales::percent_format(accuracy = 1))
presidentielles_2002 %>%
filter(tour == 1) %>%
group_by(INSEE_COM) %>%
summarise(value = sum(nb_voix[nom == "CHEVENEMENT"]) / sum(nb_voix)) %>%
left_join(communes, by = "INSEE_COM") %>%
left_join(communes_details, by = "INSEE_COM") %>%
filter(CODE_DEPT %in% c("77", "78", "91", "95")) %>%
ggplot(.) + aes(long, lat, group = group) + theme_void() + coord_equal() +
geom_polygon(aes(fill = value), colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white",
name = "Chevènement T1",
labels = scales::percent_format(accuracy = 1))
presidentielles_2002 %>%
filter(tour == 1) %>%
mutate(depts_code = substr(INSEE_COM, 1, 2)) %>%
group_by(depts_code) %>%
summarise(value = sum(nb_voix[nom == "LE PEN"]) / sum(nb_voix)) %>%
right_join(france, by = "depts_code") %>%
ggplot(.) + aes(long, lat, group = group) + theme_void() + coord_map() +
geom_polygon(aes(fill = value), colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white",
name = "Le Pen T1",
labels = scales::percent_format(accuracy = 1))
presidentielles_2002 %>%
filter(tour == 1) %>%
group_by(INSEE_COM) %>%
summarise(value = sum(nb_voix[nom == "LE PEN"]) / sum(nb_voix)) %>%
left_join(communes, by = "INSEE_COM") %>%
left_join(communes_details, by = "INSEE_COM") %>%
filter(CODE_DEPT %in% c("92")) %>%
ggplot(.) + aes(long, lat, group = group) + theme_void() + coord_equal() +
geom_polygon(aes(fill = value), colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white",
name = "Le Pen T1",
labels = scales::percent_format(accuracy = 1))
presidentielles_2002 %>%
filter(tour == 1) %>%
group_by(INSEE_COM) %>%
summarise(value = sum(nb_voix[nom == "LE PEN"]) / sum(nb_voix)) %>%
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) + theme_void() + coord_equal() +
geom_polygon(aes(fill = value), colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white",
name = "Le Pen T1",
labels = scales::percent_format(accuracy = 1))
presidentielles_2002 %>%
filter(tour == 1) %>%
group_by(INSEE_COM) %>%
summarise(value = sum(nb_voix[nom == "LE PEN"]) / sum(nb_voix)) %>%
left_join(communes, by = "INSEE_COM") %>%
left_join(communes_details, by = "INSEE_COM") %>%
filter(CODE_DEPT %in% c("77", "78", "91", "95")) %>%
ggplot(.) + aes(long, lat, group = group) + theme_void() + coord_equal() +
geom_polygon(aes(fill = value), colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white",
name = "Le Pen T1",
labels = scales::percent_format(accuracy = 1))
presidentielles_2002 %>%
filter(tour == 2) %>%
mutate(depts_code = substr(INSEE_COM, 1, 2)) %>%
group_by(depts_code) %>%
summarise(value = sum(nb_voix[nom == "LE PEN"]) / sum(nb_voix)) %>%
right_join(france, by = "depts_code") %>%
ggplot(.) + aes(long, lat, group = group) + theme_void() + coord_map() +
geom_polygon(aes(fill = value), colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white",
name = "Le Pen T2",
labels = scales::percent_format(accuracy = 1))
presidentielles_2002 %>%
filter(tour == 2) %>%
group_by(INSEE_COM) %>%
summarise(value = sum(nb_voix[nom == "LE PEN"]) / sum(nb_voix)) %>%
left_join(communes, by = "INSEE_COM") %>%
left_join(communes_details, by = "INSEE_COM") %>%
filter(CODE_DEPT %in% c("92")) %>%
ggplot(.) + aes(long, lat, group = group) + theme_void() + coord_equal() +
geom_polygon(aes(fill = value), colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white",
name = "Le Pen T2",
labels = scales::percent_format(accuracy = 1))
presidentielles_2002 %>%
filter(tour == 2) %>%
group_by(INSEE_COM) %>%
summarise(value = sum(nb_voix[nom == "LE PEN"]) / sum(nb_voix)) %>%
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) + theme_void() + coord_equal() +
geom_polygon(aes(fill = value), colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white",
name = "Le Pen T2",
labels = scales::percent_format(accuracy = 1))
presidentielles_2002 %>%
filter(tour == 2) %>%
group_by(INSEE_COM) %>%
summarise(value = sum(nb_voix[nom == "LE PEN"]) / sum(nb_voix)) %>%
left_join(communes, by = "INSEE_COM") %>%
left_join(communes_details, by = "INSEE_COM") %>%
filter(CODE_DEPT %in% c("77", "78", "91", "95")) %>%
ggplot(.) + aes(long, lat, group = group) + theme_void() + coord_equal() +
geom_polygon(aes(fill = value), colour = alpha("black", 1/2), size = 0.2) +
scale_fill_viridis_c(na.value = "white",
name = "Le Pen T2",
labels = scales::percent_format(accuracy = 1))