TX.VAL.MRCH.CD.WT |>
right_join(iso2c, by = "iso2c") |>
filter(iso2c %in% c("1W", "CH", "BE", "NL", "PO", "SE", "TR")) |>
year_to_date() |>
group_by(date) |>
mutate(value = value/value[iso2c == "1W"]) |>
filter(!(iso2c == "1W")) |>
add_flag_color("Iso2c") |>
ggplot() + theme_minimal() + scale_color_identity() + xlab("") + ylab("% of Merchandise exports") +
geom_line(aes(x = date, y = value, color = color)) +
geom_image(data = . %>%
filter(date == as.Date("1967-01-01")) %>%
mutate(image = paste0("../../icon/flag/", str_to_lower(gsub(" ", "-", Iso2c)), ".png")),
aes(x = date, y = value, image = image), asp = 1.5) +
scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(0, 70, 0.2),
labels = scales::percent_format(accuracy = .1),
limits = 0.01*c(0, 2))