WOB |>
filter(`Product Name` == "Euro-super 95",
Geo %in% c("France", "Portugal", "Spain", "Italy", "European Union (average)"),
tax == "Prices with taxes") |>
mutate(Geo = ifelse(Geo == "European Union (average)", "Europe", Geo)) |>
mutate(values = values/1000) |>
filter(date >= Sys.Date() %m-% months(6)) |>
left_join(colors, by = c("Geo" = "country")) |>
ggplot() + geom_line(aes(x = date, y = values, color = color)) +
theme_minimal() + xlab("") + ylab("Euro-super 95, Price with taxes") + scale_color_identity() +
scale_x_date(breaks = seq.Date(as.Date("2018-09-10"), Sys.Date(), "1 week"),
labels = scales::date_format("%d %b %Y")) + add_flags +
scale_y_continuous(breaks = seq(-100, 100, 0.05),
labels = scales::dollar_format(a = .01, pre = "", su = " €/L")) +
theme(legend.position = c(0.3, 0.95),
axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1),
legend.title = element_blank())