UNE_DEAP_SEX_AGE_RT_Q |>
filter(ref_area %in% c("USA", "JPN", "CAN"),
sex == "SEX_T",
classif1 == "AGE_AGGREGATE_YGE15") |>
left_join(ref_area, by = "ref_area") |>
quarter_to_date() |>
mutate(obs_value = obs_value/100) |>
left_join(colors, by = c("Ref_area" = "country")) |>
ggplot() + geom_line(aes(x = date, y = obs_value, color = color)) +
scale_color_identity() + add_flags + theme_minimal() +
xlab("") + ylab("Unemployment rate") +
theme(legend.title = element_blank(),
legend.position = c(0.15, 0.85)) +
scale_x_date(breaks = seq(1900, 2100, 5) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-100, 10000, 2),
labels = percent_format(a = 1)) +
geom_hline(yintercept = 0, linetype = "dashed", color = "grey")