DPE_m2 %>%
gather(DPE, value, -taille) %>%
mutate(taille2 = ifelse(taille == "- de 30m2", "Moins de 30m2", "Plus de 30m2")) %>%
group_by(taille2, DPE) %>%
summarise(value = sum(value)) %>%
group_by(taille2) %>%
mutate(value = value/value[DPE == "TOTAL"]) %>%
filter(DPE != "TOTAL") %>%
ggplot + geom_line(aes(x = DPE, y = value, linetype = taille2, group = taille2)) +
theme_minimal() + xlab("") + ylab("") +
scale_y_continuous(breaks = 0.01*seq(-30, 50, 5),
labels = percent_format(accuracy = 1)) +
theme(legend.position = c(0.15, 0.8),
legend.title = element_blank()) +
theme(axis.text.x = element_text(size = 15, colour = c("#339a33", "#33cc33", "#ccff33",
"#ffff00", "#ffcc00", "#ff9a33", "#ff0000"))) +
geom_vline(xintercept = "A", color = "#339a33", linetype = "dashed") +
geom_vline(xintercept = "B", color = "#33cc33", linetype = "dashed") +
geom_vline(xintercept = "C", color = "#ccff33", linetype = "dashed") +
geom_vline(xintercept = "D", color = "#ffff00", linetype = "dashed") +
geom_vline(xintercept = "E", color = "#ffcc00", linetype = "dashed") +
geom_vline(xintercept = "F", color = "#ff9a33", linetype = "dashed") +
geom_vline(xintercept = "G", color = "#ff0000", linetype = "dashed")