p2d_2019.fr %>%
year_to_date2 %>%
filter(variable %in% c("deces_moins_de_7_jours", "nes_vivants"),
dep_region %in% c("Hauts-de-Seine", "Paris", "Seine-Saint-Denis")) %>%
spread(variable, value) %>%
mutate(value = 1000*deces_moins_de_7_jours/nes_vivants) %>%
ggplot + geom_line(aes(x = date, y = value, color = dep_region)) +
scale_color_manual(values = viridis(4)[1:3]) +
xlab("") + ylab("") + theme_minimal() +
scale_x_date(breaks = seq(1920, 2025, 5) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
theme(legend.position = c(0.8, 0.9),
legend.title = element_blank()) +
scale_y_continuous(breaks = seq(0, 100, 0.2),
labels = dollar_format(a = .1, pre = "", su = "‰"))