Exchange Rates, Daily

Data - BIS

Info

source dataset .html .RData
bis XRU 2024-12-16 2024-12-16
bis XRU_D 2024-12-16 2024-12-16

Data on xrates

source dataset .html .RData
bdf EXR 2024-12-13 2024-12-13
bis EER 2024-12-16 2024-12-16
bis EER_D 2024-11-18 2024-05-10
bis XRU 2024-12-16 2024-12-16
bis XRU_D 2024-12-16 2024-12-16
ecb EXR 2024-12-16 2024-12-16
eurostat ert_bil_eur_d 2024-12-16 2024-12-16
eurostat ert_h_eur_d 2024-12-16 2024-12-16
fred xrates 2024-12-16 2024-12-16
gfd xrates 2024-06-20 2021-01-08
oecd REFSERIES_MSIT 2024-09-15 2024-12-14
oecd SNA_TABLE4 2024-09-15 2024-12-14
wdi PA.NUS.FCRF 2024-12-14 2024-12-14

Data on monetary policy

source dataset .html .RData
bdf FM 2024-12-14 2024-12-14
bdf MIR 2024-07-26 2024-07-01
bdf MIR1 2024-11-29 2024-12-09
bis CBPOL 2024-11-19 2024-11-19
ecb BSI 2024-11-19 2024-11-19
ecb BSI_PUB 2024-11-19 2024-11-21
ecb FM 2024-12-06 2024-12-06
ecb ILM 2024-10-08 2024-11-21
ecb ILM_PUB 2024-10-08 2024-09-10
ecb liq_daily 2024-10-08 2024-09-11
ecb MIR 2024-06-19 2024-12-06
ecb RAI 2024-10-08 2024-10-30
ecb SUP 2024-10-08 2024-10-08
ecb YC 2024-11-19 2024-11-19
ecb YC_PUB 2024-10-08 2024-10-08
eurostat ei_mfir_m 2024-12-14 2024-12-14
eurostat irt_st_m 2024-12-06 2024-12-06
fred r 2024-12-14 2024-12-14
oecd MEI 2024-04-16 2024-06-30
oecd MEI_FIN 2024-09-15 2024-12-14

LAST_COMPILE

LAST_COMPILE
2024-12-16

Last

date Nobs
2024-01-29 63

iso3c, iso2c, Reference area

Code
XRU_D %>%
  arrange(iso3c, date) %>%
  group_by(iso3c, iso2c, `Reference area`) %>%
  summarise(Nobs = n(),
            start = first(date),
            end = last(date)) %>%
  arrange(-Nobs) %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(`Reference area`)),
         Flag = paste0('<img src="../../icon/flag/vsmall/', Flag, '.png" alt="Flag">')) %>%
  select(Flag, everything()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}

FREQ, Frequency

Code
XRU_D %>%
  group_by(FREQ, Frequency) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) print_table(.) else .}
FREQ Frequency Nobs
D Daily 930840

CURRENCY

Code
XRU_D %>%
  group_by(CURRENCY, Currency) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Germany, France, Italy, Spain, Greece

All-

Code
XRU_D %>%
  filter(iso3c %in% c("DEU", "FRA", "ITA", "ESP", "GRC")) %>%
  left_join(colors, by = c("Reference area" = "country")) %>%
  ggplot(.) + geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + xlab("") + ylab("1 USD in National Currency") +
  scale_x_date(breaks = seq(1940, 2025, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 10, 0.2),
                     labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "")) +
  scale_color_identity() + add_5flags +
  theme(legend.position = c(0.8, 0.80),
        legend.title = element_blank())

1970-

Code
XRU_D %>%
  filter(iso3c %in% c("DEU", "FRA", "ITA", "ESP", "GRC"),
         date >= as.Date("1970-01-01")) %>%
  left_join(colors, by = c("Reference area" = "country")) %>%
  ggplot(.) + geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + xlab("") + ylab("1 USD in National Currency") +
  scale_x_date(breaks = seq(1940, 2025, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 10, 0.2),
                     labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "../$")) +
  scale_color_identity() + add_5flags +
  theme(legend.position = c(0.8, 0.80),
        legend.title = element_blank())

1980-

Code
XRU_D %>%
  filter(iso3c %in% c("DEU", "FRA", "ITA", "ESP", "GRC"),
         date >= as.Date("1980-01-01")) %>%
  left_join(colors, by = c("Reference area" = "country")) %>%
  ggplot(.) + geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + xlab("") + ylab("1 USD in National Currency") +
  scale_x_date(breaks = seq(1940, 2025, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 10, 0.2),
                     labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "../$")) +
  scale_color_identity() + add_5flags +
  theme(legend.position = c(0.8, 0.80),
        legend.title = element_blank())

Germany, France, Italy, Spain

All-

Code
XRU_D %>%
  filter(iso3c %in% c("DEU", "FRA", "ITA", "ESP")) %>%
  left_join(colors, by = c("Reference area" = "country")) %>%
  ggplot(.) + geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + xlab("") + ylab("1 USD in National Currency") +
  scale_x_date(breaks = seq(1940, 2025, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 10, 0.2),
                     labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "../$")) +
  scale_color_identity() + add_4flags +
  theme(legend.position = c(0.8, 0.80),
        legend.title = element_blank())

1970-

Code
XRU_D %>%
  filter(iso3c %in% c("DEU", "FRA", "ITA", "ESP"),
         date >= as.Date("1970-01-01")) %>%
  left_join(colors, by = c("Reference area" = "country")) %>%
  ggplot(.) + geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + xlab("") + ylab("1 USD in National Currency") +
  scale_x_date(breaks = seq(1940, 2025, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 10, 0.2),
                     labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "../$")) +
  scale_color_identity() + add_4flags +
  theme(legend.position = c(0.8, 0.80),
        legend.title = element_blank())

1980-

Code
XRU_D %>%
  filter(iso3c %in% c("DEU", "FRA", "ITA", "ESP"),
         date >= as.Date("1980-01-01")) %>%
  left_join(colors, by = c("Reference area" = "country")) %>%
  ggplot(.) + geom_line(aes(x = date, y = value, color = color)) + 
  theme_minimal() + xlab("") + ylab("1 USD in National Currency") +
  scale_x_date(breaks = seq(1940, 2025, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 10, 0.2),
                     labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "../$")) +
  scale_color_identity() + add_4flags +
  theme(legend.position = c(0.8, 0.80),
        legend.title = element_blank())

Individual Countries (Euro)

Hungary and Poland / Germany

All

Code
XRU_D %>%
  filter(iso3c %in% c("POL", "DEU", "HUN"),
         COLLECTION == "A") %>%
  arrange(date) %>%
  group_by(date) %>%
  filter(n() == 3) %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  transmute(date,
            `Poland` = POL/DEU,
            `Hungary` = HUN/DEU) %>%
  gather(variable, value, -date) %>%
  left_join(tibble(variable = c("Poland", "Hungary"),
                   Variable = c("Poland złoty ", "Hungarian forint"))) %>%
  group_by(variable) %>%
  mutate(`Reference area` = variable) %>%
  mutate(value = 100*value/value[date == as.Date("1984-01-02")]) %>%
  na.omit %>%
  ggplot(.) + geom_line(aes(x = date, y = value, color = Variable)) + theme_minimal() +
  add_2flags +
  scale_color_manual(values = c("#436F4D", "#DC143C")) +
  xlab("") + ylab("Nominal Exchange Rate VS. Euro (Base = 100)") +
  scale_x_date(breaks = seq(1940, 2025, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(legend.position = c(0.8, 0.2),
        legend.title = element_blank()) +
  scale_y_log10(breaks = c(100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000),
                labels = dollar_format(a = 1, p = ""))

1995-

Code
XRU_D %>%
  filter(iso3c %in% c("POL", "DEU", "HUN"),
         COLLECTION == "A",
         date >= as.Date("1995-01-01")) %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  transmute(date,
            `Poland` = POL/DEU,
            `Hungary` = HUN/DEU) %>%
  gather(variable, value, -date) %>%
  left_join(tibble(variable = c("Poland", "Hungary"),
                   Variable = c("Poland złoty ", "Hungarian forint"))) %>%
  group_by(variable) %>%
  mutate(`Reference area` = variable) %>%
  mutate(value = 100*value/value[date == as.Date("1995-01-03")]) %>%
  na.omit %>%
  ggplot(.) + geom_line(aes(x = date, y = value, color = Variable)) + theme_minimal() +
  add_2flags +
  scale_color_manual(values = c("#436F4D", "#DC143C")) +
  xlab("") + ylab("Nominal Exchange Rate VS. Euro (Base = 100)") +
  scale_x_date(breaks = seq(1940, 2025, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(legend.position = c(0.8, 0.2),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(100, 400, 20),
                labels = dollar_format(a = 1, p = ""))

2018-

Code
XRU_D %>%
  filter(iso3c %in% c("POL", "DEU", "HUN"),
         COLLECTION == "A",
         date >= as.Date("2018-01-01")) %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  transmute(date,
            `Poland` = POL/DEU,
            `Hungary` = HUN/DEU) %>%
  gather(variable, value, -date) %>%
  left_join(tibble(variable = c("Poland", "Hungary"),
                   Variable = c("Poland złoty ", "Hungarian forint"))) %>%
  group_by(variable) %>%
  mutate(`Reference area` = variable) %>%
  mutate(value = 100*value/value[date == as.Date("2020-03-02")]) %>%
  na.omit %>%
  ggplot(.) + geom_line(aes(x = date, y = value, color = Variable)) + theme_minimal() +
  add_2flags +
  scale_color_manual(values = c("#436F4D", "#DC143C")) +
  xlab("") + ylab("Nominal Exchange Rate VS. Euro (Base = 100)") +
  scale_x_date(breaks = "6 months",
               labels = date_format("%b %y")) +
  theme(legend.position = c(0.8, 0.2),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(0, 600, 1),
                labels = dollar_format(a = 1, p = ""))

November 2019

Code
XRU_D %>%
  filter(iso3c %in% c("POL", "DEU", "HUN"),
         COLLECTION == "A",
         date >= as.Date("2019-11-01")) %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  transmute(date,
            `Poland` = POL/DEU,
            `Hungary` = HUN/DEU) %>%
  gather(variable, value, -date) %>%
  left_join(tibble(variable = c("Poland", "Hungary"),
                   Variable = c("Poland złoty ", "Hungarian forint"))) %>%
  group_by(variable) %>%
  mutate(`Reference area` = variable) %>%
  mutate(value = 100*value/value[date == as.Date("2020-03-02")]) %>%
  na.omit %>%
  ggplot(.) + geom_line(aes(x = date, y = value, color = Variable)) + theme_minimal() +
  add_2flags +
  scale_color_manual(values = c("#436F4D", "#DC143C")) +
  xlab("") + ylab("Nominal Exchange Rate VS. Euro (Base = 100)") +
  scale_x_date(breaks = "6 months",
               labels = date_format("%b %y")) +
  theme(legend.position = c(0.8, 0.2),
        legend.title = element_blank()) +
  scale_y_log10(breaks = seq(0, 600, 5),
                labels = dollar_format(a = 1, p = ""))

Peru

1997-

Code
XRU_D %>%
  filter(iso3c %in% c("PER"),
         date >= as.Date("1997-01-01")) %>%
  ggplot(.) + geom_line(aes(x = date, y = value)) + 
  theme_minimal() + xlab("") + ylab("Exchange Rate ($? = National Currency)") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 300, 0.1),
                     labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "../$")) +
  theme(legend.position = c(0.8, 0.80),
        legend.title = element_blank())

2010-

Code
XRU_D %>%
  filter(iso3c %in% c("PER"),
         date >= as.Date("2010-01-01")) %>%
  ggplot(.) + geom_line(aes(x = date, y = value)) + 
  theme_minimal() + xlab("") + ylab("Exchange Rate ($? = National Currency)") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 300, 0.1),
                     labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "../$")) +
  theme(legend.position = c(0.8, 0.80),
        legend.title = element_blank())

Poland / Germany

All

Code
XRU_D %>%
  filter(iso3c %in% c("POL", "DEU"),
         COLLECTION == "A") %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  na.omit %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = POL/DEU) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 600, 1),
                labels = dollar_format(a = 1, p = "", su = " /€"))

1997-

Code
XRU_D %>%
  filter(iso3c %in% c("POL", "DEU"),
         COLLECTION == "A",
         date >= as.Date("1997-01-01")) %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = POL/DEU) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 600, .1),
                labels = dollar_format(a = .1, p = "", su = " /€"))

2015-

Code
XRU_D %>%
  filter(iso3c %in% c("POL", "DEU"),
         COLLECTION == "A",
         date >= as.Date("2015-01-01")) %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = POL/DEU) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 600, .1),
                labels = dollar_format(a = .1, p = "", su = " /€"))

Hungary / Germany

All

Code
XRU_D %>%
  filter(iso3c %in% c("HUN", "DEU"),
         COLLECTION == "A") %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  na.omit %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = HUN/DEU) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 600, 1),
                labels = dollar_format(a = 1, p = "", su = " /€"))

1997-

Code
XRU_D %>%
  filter(iso3c %in% c("HUN", "DEU"),
         COLLECTION == "A",
         date >= as.Date("1997-01-01")) %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = HUN/DEU) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 600, .1),
                labels = dollar_format(a = .1, p = "", su = " /€"))

2015-

Code
XRU_D %>%
  filter(iso3c %in% c("HUN", "DEU"),
         COLLECTION == "A",
         date >= as.Date("2015-01-01")) %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = HUN/DEU) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 600, 10),
                labels = dollar_format(a = .1, p = "", su = " /€"))

2019-

Code
XRU_D %>%
  filter(iso3c %in% c("HUN", "DEU"),
         COLLECTION == "A",
         date >= as.Date("2019-06-01")) %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = HUN/DEU) + xlab("") + ylab("") +
  scale_x_date(breaks = "2 months",
               labels = date_format("%b %y")) +
  scale_y_log10(breaks = seq(0, 600, 10),
                labels = dollar_format(a = .1, p = "", su = " /€"))

United Kingdom / Germany

All

Code
XRU_D %>%
  filter(iso3c %in% c("GBR", "DEU"),
         COLLECTION == "A") %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  na.omit %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = GBR/DEU) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 600, .1),
                labels = dollar_format(a = .1, p = "", su = " /€"))

1953-1965

Code
XRU_D %>%
  filter(iso3c %in% c("GBR", "DEU"),
         COLLECTION == "A") %>%
  filter(date <= as.Date("1965-01-01")) %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  na.omit %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = GBR/DEU) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 600, .001),
                labels = dollar_format(a = .001, p = "", su = " /€"))

1990-

Code
XRU_D %>%
  filter(iso3c %in% c("GBR", "DEU"),
         COLLECTION == "A",
         date >= as.Date("1990-01-01")) %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  na.omit %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = GBR/DEU) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 600, .1),
                labels = dollar_format(a = .1, p = "", su = " /€"))

2000-

Code
XRU_D %>%
  filter(iso3c %in% c("GBR", "DEU"),
         COLLECTION == "A",
         date >= as.Date("2000-01-01")) %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  na.omit %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = GBR/DEU) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 600, .1),
                labels = dollar_format(a = .1, p = "", su = " /€"))

2010-

Code
XRU_D %>%
  filter(iso3c %in% c("GBR", "DEU"),
         COLLECTION == "A",
         date >= as.Date("2010-01-01")) %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  na.omit %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = GBR/DEU) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 600, .05),
                labels = dollar_format(a = .01, p = "", su = " /€"))

2015-

Code
XRU_D %>%
  filter(iso3c %in% c("GBR", "DEU"),
         COLLECTION == "A",
         date >= as.Date("2015-01-01")) %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  na.omit %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = GBR/DEU) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 600, .05),
                labels = dollar_format(a = .01, p = "", su = " /€"))

2016-2017

Code
XRU_D %>%
  filter(iso3c %in% c("GBR", "DEU"),
         COLLECTION == "A",
         date >= as.Date("2016-01-01"),
         date <= as.Date("2016-12-31")) %>%
  select(date, iso3c, value) %>%
  spread(iso3c, value) %>%
  na.omit %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = GBR/DEU) + xlab("") + ylab("") +
  scale_x_date(breaks = "1 month",
               labels = date_format("%b %y")) +
  scale_y_log10(breaks = seq(0, 600, .02),
                labels = dollar_format(a = .01, p = "", su = " /€")) + 
  geom_vline(xintercept = as.Date("2016-06-23"), linetype = "dashed", color = viridis(3)[2])

Individual Countries

United States

Code
XRU_D %>%
  filter(iso3c %in% c("USA")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = seq(0, 600, 1),
                labels = dollar_format(a = 1, p = ""))

Japan

All

Code
XRU_D %>%
  filter(iso3c %in% c("JPN")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = c(seq(0, 600, 50), seq(50, 150, 10)),
                labels = dollar_format(a = 1, p = "", su = " ¥/$"))

1985-

Code
XRU_D %>%
  filter(iso3c %in% c("JPN"),
         date >= "1985-01-01") %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = c(seq(0, 600, 50), seq(50, 150, 10)),
                labels = dollar_format(a = 1, p = "", su = " ¥/$"))

2000-

Code
XRU_D %>%
  filter(iso3c %in% c("JPN"),
         date >= "2000-01-01") %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = c(seq(0, 600, 50), seq(50, 150, 10)),
                labels = dollar_format(a = 1, p = "", su = " ¥/$"))

China

Code
XRU_D %>%
  filter(iso3c %in% c("CHN")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = seq(0, 20, 1),
                labels = dollar_format(a = 1, p = "", su = " ¥/$"))

Iceland

All

Code
XRU_D %>%
  filter(iso3c %in% c("ISL")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = seq(0, 600, 10),
                labels = dollar_format(a = 1, p = ""))

2000-

Code
XRU_D %>%
  filter(iso3c %in% c("ISL"),
         date >= as.Date("2000-01-01")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = seq(0, 600, 10),
                labels = dollar_format(a = 1, p = ""))

2007-2009

Code
XRU_D %>%
  filter(iso3c %in% c("ISL"),
         date >= as.Date("2007-01-01"),
         date <= as.Date("2009-12-31")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = "3 months",
               labels = date_format("%b %y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = seq(0, 600, 10),
                labels = dollar_format(a = 1, p = ""))

Denmark

Code
XRU_D %>%
  filter(iso3c %in% c("DNK")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = seq(0, 600, 1),
                labels = dollar_format(a = 1, p = ""))

Russia

All

Code
XRU_D %>%
  filter(iso3c %in% c("RUS")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = c(0.1, 0.2, 0.5, 1, 2, 5, 8, 10, 20, 50, 80, 100, 150),
                labels = dollar_format(a = .1, p = "", su = " RUB/$"))

2000-

Code
XRU_D %>%
  filter(iso3c %in% c("RUS"),
         date >= "2000-01-01") %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = seq(0, 600, 10),
                labels = dollar_format(a = 1, p = "", su = " RUB/$"))

2010-

Code
XRU_D %>%
  filter(iso3c %in% c("RUS"),
         date >= "2010-01-01") %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 600, 10),
                labels = dollar_format(a = 1, p = "", su = " RUB/$"))

2016-

Code
XRU_D %>%
  filter(iso3c %in% c("RUS"),
         date >= "2016-01-01") %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = "1 year",
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 600, 10),
                labels = dollar_format(a = 1, p = "", su = " RUB/$"))

2019-

Code
XRU_D %>%
  filter(iso3c %in% c("RUS"),
         date >= "2019-01-01") %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = "3 months",
               labels = date_format("%b %Y")) +
  scale_y_continuous(breaks = seq(0, 600, 10),
                     labels = dollar_format(a = 1, p = "", su = " RUB/$"),
                     trans = "reverse") + 
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1))

Switzerland

All

Code
XRU_D %>%
  filter(iso3c %in% c("CHE"),
         COLLECTION == "A") %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = c(seq(0, 600, 1), seq(0.5, 1.5, 0.1)),
                labels = dollar_format(a = .1, p = "", su = " F/$"))

1990-

Code
XRU_D %>%
  filter(iso3c %in% c("CHE"),
         COLLECTION == "A",
         date >= "1990-01-01") %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = c(seq(0, 600, 1), seq(0.5, 2.5, 0.1)),
                labels = dollar_format(a = .1, p = "", su = " F/$"))

2000-

Code
XRU_D %>%
  filter(iso3c %in% c("CHE"),
         COLLECTION == "A",
         date >= "2000-01-01") %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = c(seq(0, 600, 1), seq(0.5, 2.5, 0.1)),
                labels = dollar_format(a = .1, p = "", su = " F/$"))

2010-

Code
XRU_D %>%
  filter(iso3c %in% c("CHE"),
         COLLECTION == "A",
         date >= "2010-01-01") %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(seq(0, 600, 1), seq(0.5, 2.5, 0.1)),
                labels = dollar_format(a = .1, p = "", su = " F/$"))

10 years-

Code
XRU_D %>%
  filter(iso3c %in% c("CHE"),
         COLLECTION == "A",
         date >= Sys.Date() - years(10)) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(seq(0, 600, 1), seq(0.5, 2.5, 0.02)),
                labels = dollar_format(a = .01, p = "", su = " F/$"))

Germany

All

Code
XRU_D %>%
  filter(iso3c %in% c("DEU")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = seq(0.5, 2.5, 0.1),
                labels = dollar_format(a = .1, p = "", su = " €/$"))

1961-

Code
XRU_D %>%
  filter(iso3c %in% c("DEU"),
         date >= as.Date("1961-01-01"),
         date <= as.Date("1961-07-01")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = "1 month",
               labels = date_format("%b %Y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = seq(0.5, 2.5, 0.01),
                labels = dollar_format(a = .01, p = "", su = " €/$"))

France

All

Code
XRU_D %>%
  filter(iso3c %in% c("FRA")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  scale_y_log10(breaks = seq(0.5, 2.5, 0.1),
                labels = dollar_format(a = .1, p = "", su = " €/$"))

2012-

Code
XRU_D %>%
  filter(iso3c %in% c("FRA"),
         date >= as.Date("2012-01-01")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0.5, 2.5, 0.05),
                labels = dollar_format(a = .01, p = "", su = " €/$"))

2016-2018

Code
XRU_D %>%
  filter(iso3c %in% c("FRA"),
         COLLECTION == "A",
         date >= as.Date("2016-01-01"),
         date <= as.Date("2018-01-01")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = 1/value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0.5, 2.5, 0.05),
                labels = dollar_format(a = .01, p = "$", su = " / €"))

August 2016 - August 2017

Code
XRU_D %>%
  filter(iso3c %in% c("FRA"),
         COLLECTION == "A",
         date >= as.Date("2016-08-01"),
         date <= as.Date("2017-04-01")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = 1/value) + xlab("") + ylab("") +
  scale_x_date(breaks = "1 month",
               labels = date_format("%b %y")) +
  scale_y_log10(breaks = seq(0.5, 2.5, 0.01),
                labels = dollar_format(a = .01, p = "$", su = " / €")) + 
  geom_vline(xintercept = as.Date("2016-11-08"), linetype = "dashed", color = viridis(3)[2])

1 year

Code
XRU_D %>%
  filter(iso3c %in% c("FRA"),
         date >= Sys.Date() - years(1),
         COLLECTION == "A") %>%
  arrange(desc(date)) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = "1 month",
               labels = date_format("%b %Y")) +
  scale_y_log10(breaks = seq(0.5, 2.5, 0.02),
                labels = dollar_format(a = .01, p = "", su = " €/$")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1))

1 month

Code
XRU_D %>%
  filter(iso3c %in% c("FRA"),
         date >= Sys.Date() - months(1),
         COLLECTION == "A") %>%
  arrange(desc(date)) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = "1 day",
               labels = date_format("%d %b %Y")) +
  scale_y_log10(breaks = seq(0.5, 2.5, 0.002),
                labels = dollar_format(a = .001, p = "", su = " €/$")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1))

Italy

Code
XRU_D %>%
  filter(iso3c %in% c("ITA")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0.1, 2.5, 0.1),
                labels = dollar_format(a = .1, p = "", su = " €/$")) +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1))

United Kingdom

All

Code
XRU_D %>%
  filter(iso3c %in% c("GBR")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 10) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0.1, 2.5, 0.1),
                labels = dollar_format(a = .1, p = "", su = " £/$"))

1953-1965

Code
XRU_D %>%
  filter(iso3c %in% c("GBR")) %>%
  filter(date <= as.Date("1965-01-01")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0.01, 2.5, 0.001),
                labels = dollar_format(a = .001, p = "", su = " £/$"))

2015-2018 (Brexit)

Code
XRU_D %>%
  filter(iso3c %in% c("GBR"),
         date >= as.Date("2015-01-01"),
         date <= as.Date("2018-01-01")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0.1, 2.5, 0.02),
                labels = dollar_format(a = .01, p = "", su = " £/$")) + 
  geom_vline(xintercept = as.Date("2016-06-23"), linetype = "dashed", color = viridis(3)[2])

2016-2017 (Brexit + Trump)

Code
XRU_D %>%
  filter(iso3c %in% c("GBR"),
         date >= as.Date("2016-01-01"),
         date <= as.Date("2017-01-01"),
         COLLECTION == "A") %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = "1 month",
               labels = date_format("%b %Y")) +
  scale_y_log10(breaks = seq(0.1, 2.5, 0.02),
                labels = dollar_format(a = .01, p = "", su = " £/$")) + 
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)) +
  geom_vline(xintercept = as.Date("2016-06-23"), linetype = "dashed", color = viridis(3)[2]) +
  geom_vline(xintercept = as.Date("2016-11-08"), linetype = "dashed", color = viridis(3)[2])

2015-2018

Code
XRU_D %>%
  filter(iso3c %in% c("GBR"),
         date >= as.Date("2015-01-01"),
         date <= as.Date("2020-01-01")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0.1, 2.5, 0.02),
                labels = dollar_format(a = .01, p = "", su = " £/$")) + 
  geom_vline(xintercept = as.Date("2016-06-23"), linetype = "dashed", color = viridis(3)[2])

2016

Code
XRU_D %>%
  filter(iso3c %in% c("GBR"),
         date >= as.Date("2016-01-01"),
         date <= as.Date("2016-12-31"),
         COLLECTION == "A") %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(labels = date_format("%b %y")) +
  scale_y_log10(breaks = seq(0.1, 2.5, 0.02),
                labels = dollar_format(a = .01, p = "", su = " £/$")) + 
  geom_vline(xintercept = as.Date("2016-06-23"), linetype = "dashed", color = viridis(3)[2])

2015-

Code
XRU_D %>%
  filter(iso3c %in% c("GBR"),
         date >= as.Date("2015-01-01")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0.1, 2.5, 0.02),
                labels = dollar_format(a = .01, p = "", su = " £/$"))

United Kingdom (1950-)

Code
XRU_D %>%
  filter(iso3c %in% c("GBR"),
         date >= as.Date("1950-01-01")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0.1, 2.5, 0.1),
                labels = dollar_format(a = .1, p = "", su = " £/$"))

Turkey (Lira)

All

Code
XRU_D %>%
  filter(iso3c %in% c("TUR")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(seq(0.001, 0.005, 0.001), seq(0.01, 0.05, 0.01), seq(0.1, 0.5, 0.1)),
                labels = dollar_format(a = .001, p = "", su = ""))

2000-

Code
XRU_D %>%
  filter(iso3c %in% c("TUR"),
         date >= as.Date("2000-01-01")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(seq(.1, .9, .1), seq(1, 6, 1), 10, 20),
                labels = dollar_format(a = .1, p = "", su = ""))

2005-

Code
XRU_D %>%
  filter(iso3c %in% c("TUR"),
         date >= as.Date("2005-01-01"),
         COLLECTION == "A") %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = "1 year",
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(seq(1, 1.5, .1), seq(2, 4, .5), seq(1, 9, 1), 10, 20),
                labels = dollar_format(a = .1, p = "", su = " TL/$")) + 
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1))

2020-

Code
XRU_D %>%
  filter(iso3c %in% c("TUR"),
         date >= as.Date("2020-01-01"),
         COLLECTION == "A") %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = "2 months",
               labels = date_format("%b %y")) +
  scale_y_log10(breaks = c(seq(.1, .9, .1), seq(1, 9, .5), 10, 20),
                labels = dollar_format(a = .1, p = "", su = "")) + 
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1))

Canada

Code
XRU_D %>%
  filter(iso3c %in% c("CAN")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0.1, 2.5, 0.1),
                labels = dollar_format(a = .1, p = "", su = " $C/$"))

Sweden

Code
XRU_D %>%
  filter(iso3c %in% c("SWE")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(1, 15, 1),
                labels = dollar_format(a = .1, p = "", su = " kr/$"))

Thailand Baht

Code
XRU_D %>%
  filter(iso3c %in% c("THA")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(10, 60, 5),
                labels = dollar_format(a = 1, p = "", su = " baht/$"))

Malaysia Ringgit

Code
XRU_D %>%
  filter(iso3c %in% c("MYS")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(1, 60, 0.5),
                labels = dollar_format(a = 0.1, p = "", su = " ringgit/$"))

South Korea Won

Code
XRU_D %>%
  filter(iso3c %in% c("KOR")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 3000, 100),
                labels = dollar_format(a = 1, p = "", su = " ₩/$"))

Philippine peso

Code
XRU_D %>%
  filter(iso3c %in% c("PHL")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 60, 10),
                labels = dollar_format(a = 1, p = "", su = " ₱/$"))

Singapore Dollar

Code
XRU_D %>%
  filter(iso3c %in% c("SGP")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 60, 0.1),
                labels = dollar_format(a = 0.1, p = "", su = " S$/$"))

Iceland krona

Code
XRU_D %>%
  filter(iso3c %in% c("ISL")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 3000, 10),
                labels = dollar_format(a = 1, p = "", su = " kr/$"))

Hong Kong Dollar

Code
XRU_D %>%
  filter(iso3c %in% c("HKG")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 20000, 0.5),
                labels = dollar_format(a = 0.1, p = "", su = " HK$/$"))

Indonesia peso

Code
XRU_D %>%
  filter(iso3c %in% c("IDN")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 20000, 1000),
                labels = dollar_format(a = 1, p = "", su = " peso/$"))

1995 Mexico Tequila Crisis

All

Code
XRU_D %>%
  filter(iso3c %in% c("MEX")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(seq(0, 0.05, 0.01), seq(0, 0.5, 0.1), seq(0, 5, 1), seq(0, 50, 10)),
                labels = dollar_format(a = 0.01, p = "", su = " pesos/$"))

1990-2000

Code
XRU_D %>%
  filter(iso3c %in% c("MEX"),
         date >= as.Date("1990-01-01"),
         date <= as.Date("2000-12-31")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(seq(0, 15, 1), seq(0, 50, 10)),
                labels = dollar_format(a = 1, p = "", su = " pesos/$"))

1997 Asian Financial Crisis

Philippines, Singapore, Indonesia

Code
XRU_D %>%
  filter(iso3c %in% c("IDN", "SGP", "PHL"),
         date >= as.Date("1992-01-01"),
         date <= as.Date("2002-12-31")) %>%
  group_by(iso3c) %>%
  mutate(value = 100*value / value[date == as.Date("1997-01-03")]) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value, color = `Reference area`, linetype = `Reference area`) + 
  xlab("") + ylab("") +
  scale_color_manual(values = viridis(4)[1:3]) +
  scale_x_date(breaks = seq(1800, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(50, 1000, 50),
                labels = dollar_format(a = 1, p = "")) +
  theme(legend.position = c(0.2, 0.80),
        legend.title = element_blank())

Thailand, Malaysia, South Korea

Code
XRU_D %>%
  filter(iso3c %in% c("THA", "MYS", "KOR"),
         date >= as.Date("1992-01-01"),
         date <= as.Date("2002-12-31")) %>%
  group_by(iso3c) %>%
  mutate(value = 100*value / value[date == as.Date("1997-01-03")]) %>%
  left_join(colors, by = c("Reference area" = "country")) %>%
  ggplot(.) + geom_line(aes(x = date, y = value, color = color)) + 
  add_3flags +
  xlab("") + ylab("") + theme_minimal() +
  scale_color_manual(values = viridis(4)[1:3]) +
  scale_x_date(breaks = seq(1800, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(10, 300, 10),
                labels = dollar_format(a = 1, p = "")) +
  theme(legend.position = c(0.2, 0.80),
        legend.title = element_blank()) +
  scale_color_identity()

Thailand, Malaysia, South Korea, Hong Kong

Code
XRU_D %>%
  filter(iso3c %in% c("THA", "MYS", "KOR", "HKG"),
         date >= as.Date("1992-01-01"),
         date <= as.Date("2002-12-31")) %>%
  mutate(`Reference area` = ifelse(iso3c == "HKG", "Hong Kong", `Reference area`)) %>%
  group_by(iso3c) %>%
  mutate(value = 100*value / value[date == as.Date("1997-01-03")]) %>%
  left_join(colors, by = c("Reference area" = "country")) %>%
  ggplot(.) + geom_line(aes(x = date, y = value, color = color)) + 
  add_3flags +
  xlab("") + ylab("") + theme_minimal() +
  scale_color_manual(values = viridis(4)[1:3]) +
  scale_x_date(breaks = seq(1800, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(10, 300, 10),
                labels = dollar_format(a = 1, p = "")) +
  theme(legend.position = c(0.2, 0.80),
        legend.title = element_blank()) +
  scale_color_identity()

Thailand Baht

Code
XRU_D %>%
  filter(iso3c %in% c("THA"),
         date >= as.Date("1992-01-01"),
         date <= as.Date("2002-12-31")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(10, 60, 5),
                labels = dollar_format(a = 1, p = "", su = " baht/$"))

Malaysia Ringgit

Code
XRU_D %>%
  filter(iso3c %in% c("MYS"),
         date >= as.Date("1992-01-01"),
         date <= as.Date("2002-12-31")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(1, 60, 0.5),
                labels = dollar_format(a = 0.1, p = "", su = " ringgit/$"))

South Korea Won

Code
XRU_D %>%
  filter(iso3c %in% c("KOR"),
         date >= as.Date("1992-01-01"),
         date <= as.Date("2002-12-31")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 3000, 100),
                labels = dollar_format(a = 1, p = "", su = " ₩/$"))

Philippine peso

Code
XRU_D %>%
  filter(iso3c %in% c("PHL"),
         date >= as.Date("1992-01-01"),
         date <= as.Date("2002-12-31")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 60, 10),
                labels = dollar_format(a = 1, p = "", su = " ₱/$"))

Singapore Dollar

Code
XRU_D %>%
  filter(iso3c %in% c("SGP"),
         date >= as.Date("1992-01-01"),
         date <= as.Date("2002-12-31")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 60, 0.1),
                labels = dollar_format(a = 0.1, p = "", su = " S$/$"))

Indonesia peso

Code
XRU_D %>%
  filter(iso3c %in% c("IDN"),
         date >= as.Date("1992-01-01"),
         date <= as.Date("2002-12-31")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 20000, 1000),
                labels = dollar_format(a = 1, p = "", su = " peso/$"))

2007-2009 Financial Crisis

Pound

Code
XRU_D %>%
  filter(iso3c %in% c("GBR"),
         date >= as.Date("2005-01-01"),
         date <= as.Date("2012-12-31")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 3000, 0.05),
                labels = dollar_format(a = .01, p = "", su = " £/$"))

Iceland

Code
XRU_D %>%
  filter(iso3c %in% c("ISL"),
         date >= as.Date("2005-01-01"),
         date <= as.Date("2012-12-31")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 3000, 10),
                labels = dollar_format(a = 1, p = "", su = " kr/$"))

Hungary

Code
XRU_D %>%
  filter(iso3c %in% c("HUN"),
         date >= as.Date("2002-01-01"),
         date <= as.Date("2012-12-31")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1800, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 3000, 10),
                labels = dollar_format(a = 1, p = "", su = " kr/$"))

Plaza Accords

France, Germany, United Kingdom

Code
XRU_D %>%
  filter(iso3c %in% c("DEU", "FRA", "GBR"),
         date >= as.Date("1980-01-01"),
         date <= as.Date("1990-01-01")) %>%
  left_join(colors, by = c("Reference area" = "country")) %>%
  ggplot(.) + geom_line(aes(x = date, y = value, color = color)) + 
  add_3flags +
  theme_minimal() + xlab("") + ylab("National Currency Per USD") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 10, 0.2),
                     labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "../$")) +
  theme(legend.position = c(0.6, 0.1),
        legend.title = element_blank(),
        legend.direction = "horizontal") +
  scale_color_identity()

France, Germany, United Kingdom, Japan

Code
XRU_D %>%
  filter(iso3c %in% c("DEU", "JPN", "FRA"),
         date >= as.Date("1980-01-01"),
         date <= as.Date("1990-01-01")) %>%
  left_join(colors, by = c("Reference area" = "country")) %>%
  group_by(iso3c) %>%
  mutate(color = ifelse(iso3c == "FRA", color2, color)) %>%
  mutate(value = 100*value/value[date == as.Date("1985-09-20")]) %>%
  ggplot(.) + geom_line(aes(x = date, y = value, color = color)) + 
  add_3flags +
  theme_minimal() + xlab("") + ylab("100 = Sept 20, 1985") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(10, 200, 10)) +
  theme(legend.position = c(0.6, 0.1),
        legend.title = element_blank(),
        legend.direction = "horizontal") +
  scale_color_identity()

Canada, Italy, Spain

Code
XRU_D %>%
  filter(iso3c %in% c("ITA", "CAN", "ESP"),
         date >= as.Date("1980-01-01"),
         date <= as.Date("1990-01-01")) %>%
  left_join(colors, by = c("Reference area" = "country")) %>%
  ggplot(.) + geom_line(aes(x = date, y = value, color = color)) + 
  add_3flags +
  theme_minimal() + xlab("") + ylab("National Currency Per USD") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 10, 0.2),
                     labels = dollar_format(accuracy = 0.1, prefix = "", suffix = "../$")) +
  scale_color_manual(values = viridis(4)[1:3]) +
  theme(legend.position = c(0.6, 0.1),
        legend.title = element_blank(),
        legend.direction = "horizontal") +
  scale_color_identity()

Japan (1980-1990)

Code
XRU_D %>%
  filter(iso3c %in% c("JPN"),
         date >= as.Date("1980-01-01"),
         date <= as.Date("1990-01-01")) %>%
  ggplot(.) + geom_line() + theme_minimal() +
  aes(x = date, y = value) + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1940, 2030, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = c(seq(0, 600, 50), seq(50, 300, 10)),
                labels = dollar_format(a = 1, p = "", su = " ¥/$"))