from = "2015-01-01"
ecb = ecb_data(
flow = "FM", key = "B.U2.EUR.4F.KR.DFR.LEV",
start_period = from
)
boe = boe_data("IUDBEDR", start_date = from)
srb = srb_data("SECBREPOEFF", start_date = from)
# each *_data() is a tidy data.table -> stack them
rates = rbindlist(
list(ECB = ecb, BoE = boe, Riksbank = srb),
idcol = "bank",
fill = TRUE
)
ggplot(rates, aes(date, value, color = bank)) +
geom_step(linewidth = 1.1) +
scale_color_manual(values = ok) +
scale_y_continuous(labels = label_percent(scale = 1)) +
labs(
title = "Central bank policy rates",
caption = sprintf(
"Source: ECB, Bank of England, Sveriges Riksbank, %s.",
format(max(rates$date), "%B %Y")
)
)