SNA_TABLE11 |>
filter(LOCATION %in% c("DEU", "FRA", "ITA"),
# TLYCG: Total government expenditure
TRANSACT == "TLYCG",
# 0701: Health
ACTIVITY %in% c("0701"),
# GS13: General government
SECTOR == "GS13") |>
left_join(SNA_TABLE11_var$LOCATION, by = "LOCATION") |>
left_join(SNA_TABLE1 |>
filter(TRANSACT == "B1_GE",
MEASURE == "C") |>
select(obsTime, LOCATION, B1_GE = obsValue),
by = c("LOCATION", "obsTime")) |>
group_by(LOCATION) |>
mutate(B1_GE_t = log(B1_GE) |> hpfilter(100000) |> pluck("trend") |> exp(),
obsValue = obsValue / B1_GE_t) |>
year_to_date() |>
ggplot() + theme_minimal() + xlab("") + ylab("Medical products, appliances and equipment") +
geom_line(aes(x = date, y = obsValue, color = Location)) +
geom_image(data = . %>%
filter(date == as.Date("2015-01-01")) %>%
mutate(image = paste0("../../icon/flag/", str_to_lower(Location), ".png")),
aes(x = date, y = obsValue, image = image), asp = 1.5) +
scale_color_manual(values = c("#002395", "#000000", "#009246")) +
scale_x_date(breaks = as.Date(paste0(seq(1960, 2020, 1), "-01-01")),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-60, 60, 0.2),
labels = scales::percent_format(accuracy = 0.1),
limits = c(0, 0.018)) +
theme(legend.position = c(0.85, 0.2),
legend.title = element_blank())
100 - Social protection
% of GDP
Code
% of GDP
Code
% of detrended GDP
Code