Prices, Consumer Price Index, All items, Percentage change, Corresponding period previous year, Percent

Data - IMF

FREQ

Code
PCPI_PC_CP_A_PT |>
  group_by(FREQ) |>
  summarise(Nobs = n()) |>
  arrange(-Nobs) |>
  print_table_conditional()
FREQ Nobs
M 100658
Q 36292
A 9453

REF_AREA

All

Code
PCPI_PC_CP_A_PT |>
  left_join(REF_AREA, by = "REF_AREA") |>
  group_by(REF_AREA, Ref_area) |>
  summarise(Nobs = n(),
            min = first(TIME_PERIOD),
            max = last(TIME_PERIOD)) |>
  arrange(-Nobs) |>
  mutate(Flag = gsub(" ", "-", str_to_lower(gsub(" ", "-", Ref_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 .}

Monthly

Code
PCPI_PC_CP_A_PT |>
  filter(FREQ == "M") |>
  left_join(REF_AREA, by = "REF_AREA") |>
  group_by(REF_AREA, Ref_area) |>
  summarise(Nobs = n(),
            min = first(TIME_PERIOD),
            max = last(TIME_PERIOD)) |>
  arrange(-Nobs) |>
  mutate(Flag = gsub(" ", "-", str_to_lower(gsub(" ", "-", Ref_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 .}

Quarterly

Code
PCPI_PC_CP_A_PT |>
  filter(FREQ == "Q") |>
  left_join(REF_AREA, by = "REF_AREA") |>
  group_by(REF_AREA, Ref_area) |>
  summarise(Nobs = n(),
            min = first(TIME_PERIOD),
            max = last(TIME_PERIOD)) |>
  arrange(-Nobs) |>
  mutate(Flag = gsub(" ", "-", str_to_lower(gsub(" ", "-", Ref_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 .}

Annual

Code
PCPI_PC_CP_A_PT |>
  filter(FREQ == "A") |>
  left_join(REF_AREA, by = "REF_AREA") |>
  group_by(REF_AREA, Ref_area) |>
  summarise(Nobs = n(),
            min = first(TIME_PERIOD),
            max = last(TIME_PERIOD)) |>
  arrange(-Nobs) |>
  mutate(Flag = gsub(" ", "-", str_to_lower(gsub(" ", "-", Ref_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 .}

New Zealand

All

Code
PCPI_PC_CP_A_PT |>
  filter(REF_AREA %in% c("NZ"),
         FREQ == "A") |>
  year_to_date2() |>
  transmute(date, value = OBS_VALUE/100, variable = "Inflation") |>
  bind_rows(CBPOL_M |>
              filter(REF_AREA %in% c("NZ"),
                     FREQ == "M") |>
              transmute(date, value = OBS_VALUE/100, variable = "Policy rates")) |>
  filter(date >= as.Date("1980-01-01")) |>
  ggplot() + theme_minimal() + xlab("") + ylab("") +
  geom_line(aes(x = date, y = value, color = variable)) +
  scale_y_continuous(breaks = 0.01*seq(-100, 300, 5),
                     labels = scales::percent_format(accuracy = 1)) +
  theme(legend.position = c(0.65, 0.85),
        legend.title = element_blank()) +
  scale_x_date(breaks = as.Date(paste0(seq(1700, 2030, 5), "-01-01")),
               labels = date_format("%Y"))

1985-

Code
PCPI_PC_CP_A_PT |>
  filter(REF_AREA %in% c("NZ"),
         FREQ == "A") |>
  year_to_date2() |>
  transmute(date, value = OBS_VALUE/100, variable = "Inflation") |>
  bind_rows(CBPOL_M |>
              filter(REF_AREA %in% c("NZ"),
                     FREQ == "M") |>
              transmute(date, value = OBS_VALUE/100, variable = "Policy rates")) |>
  filter(date >= as.Date("1985-01-01")) |>
  ggplot() + theme_minimal() + xlab("") + ylab("") +
  geom_line(aes(x = date, y = value, color = variable)) +
  scale_y_continuous(breaks = 0.01*seq(-100, 300, 5),
                     labels = scales::percent_format(accuracy = 1)) +
  theme(legend.position = c(0.65, 0.85),
        legend.title = element_blank()) +
  scale_x_date(breaks = as.Date(paste0(seq(1700, 2030, 5), "-01-01")),
               labels = date_format("%Y"))

France, Germany, Italy, United States

Code
PCPI_PC_CP_A_PT |>
  filter(REF_AREA %in% c("FR", "DE", "IT", "US"),
         FREQ == "M") |>
  left_join(REF_AREA, by = "REF_AREA") |>
  month_to_date2() |>
    mutate(OBS_VALUE = OBS_VALUE / 100) |>
  left_join(colors, by = c("Ref_area" = "country")) |>
ggplot() + scale_color_identity() + add_flags + theme_minimal() +
  geom_line(aes(x = date, y = OBS_VALUE, color = color)) +
  scale_y_continuous(breaks = 0.01*seq(-100, 300, 5),
                     labels = scales::percent_format(accuracy = 1)) +
  theme(legend.position = c(0.65, 0.85),
        legend.title = element_blank()) +
  scale_x_date(breaks = as.Date(paste0(seq(1700, 2030, 5), "-01-01")),
               labels = date_format("%Y")) + 
  xlab("") + ylab("Inflation Rates")

Japan, Canada, Australia, UK

Code
PCPI_PC_CP_A_PT |>
  filter(REF_AREA %in% c("JP", "CA", "AU", "GB"),
         FREQ == "M") |>
  left_join(REF_AREA, by = "REF_AREA") |>
  month_to_date2() |>
    mutate(OBS_VALUE = OBS_VALUE / 100) |>
  left_join(colors, by = c("Ref_area" = "country")) |>
ggplot() + scale_color_identity() + add_flags + theme_minimal() +
  geom_line(aes(x = date, y = OBS_VALUE, color = color)) +
  scale_y_continuous(breaks = 0.01*seq(-100, 300, 5),
                     labels = scales::percent_format(accuracy = 1)) +
  theme(legend.position = c(0.65, 0.85),
        legend.title = element_blank()) +
  scale_x_date(breaks = as.Date(paste0(seq(1700, 2030, 5), "-01-01")),
               labels = date_format("%Y")) + 
  xlab("") + ylab("Inflation Rates")

Spain, Austria, Norway, Sweden

Code
PCPI_PC_CP_A_PT |>
  filter(REF_AREA %in% c("ES", "AT", "NO", "SE"),
         FREQ == "M") |>
  left_join(REF_AREA, by = "REF_AREA") |>
  month_to_date2() |>
    mutate(OBS_VALUE = OBS_VALUE / 100) |>
  left_join(colors, by = c("Ref_area" = "country")) |>
ggplot() + scale_color_identity() + add_flags + theme_minimal() +
  geom_line(aes(x = date, y = OBS_VALUE, color = color)) +
  scale_y_continuous(breaks = 0.01*seq(-100, 300, 5),
                     labels = scales::percent_format(accuracy = 1)) +
  theme(legend.position = c(0.65, 0.85),
        legend.title = element_blank()) +
  scale_x_date(breaks = as.Date(paste0(seq(1700, 2030, 5), "-01-01")),
               labels = date_format("%Y")) + 
  xlab("") + ylab("Inflation Rates")

Ireland, Greece, Denmark, Iceland

Code
PCPI_PC_CP_A_PT |>
  filter(REF_AREA %in% c("IE", "GR", "DK", "IS"),
         FREQ == "M") |>
  left_join(REF_AREA, by = "REF_AREA") |>
  month_to_date2() |>
    mutate(OBS_VALUE = OBS_VALUE / 100) |>
  left_join(colors, by = c("Ref_area" = "country")) |>
ggplot() + scale_color_identity() + add_flags + theme_minimal() +
  geom_line(aes(x = date, y = OBS_VALUE, color = color)) +
  scale_y_continuous(breaks = 0.01*seq(-100, 300, 5),
                     labels = scales::percent_format(accuracy = 1)) +
  theme(legend.position = c(0.65, 0.85),
        legend.title = element_blank()) +
  scale_x_date(breaks = as.Date(paste0(seq(1700, 2030, 5), "-01-01")),
               labels = date_format("%Y")) + 
  xlab("") + ylab("Inflation Rates")