Housing, Water, Electricity, Gas and Other Fuels - PCPIH_IX

Data - IMF - CPI

FREQ

Code
PCPIH_IX %>%
  group_by(FREQ) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  print_table_conditional()
FREQ Nobs
M 37451
Q 13060
A 3150

REF_AREA

Code
PCPIH_IX %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  group_by(REF_AREA, Ref_area, FREQ) %>%
  summarise(Nobs = n(),
            first = first(TIME_PERIOD),
            last = 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 .}

3 Countries

France, Germany, UK

Annual

Code
PCPIH_IX %>%
  filter(REF_AREA %in% c("GB", "FR", "DE"),
         FREQ == "A") %>%
  year_to_date2() %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  filter(!is.na(OBS_VALUE)) %>%
  ggplot(.) + theme_minimal() + xlab("") + ylab("") +
  geom_line(aes(x = date, y = OBS_VALUE, color = Ref_area, linetype = Ref_area)) + 
  scale_x_date(breaks = seq(1950, 2020, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  scale_y_log10(breaks = seq(0, 200, 10),
                     labels = dollar_format(accuracy = 1, prefix = "")) +
  scale_color_manual(values = viridis(5)[1:4]) +
  theme(legend.position = c(0.2, 0.80),
        legend.title = element_blank())

Monthly

Code
PCPIH_IX %>%
  filter(REF_AREA %in% c("GB", "FR", "DE"),
         FREQ == "M") %>%
  month_to_date2() %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  filter(!is.na(OBS_VALUE)) %>%
  ggplot(.) + theme_minimal() + xlab("") + ylab("") +
  geom_line(aes(x = date, y = OBS_VALUE, color = Ref_area, linetype = Ref_area)) + 
  scale_x_date(breaks = seq(1950, 2020, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  scale_y_log10(breaks = seq(0, 200, 10),
                     labels = dollar_format(accuracy = 1, prefix = "")) +
  scale_color_manual(values = viridis(5)[1:4]) +
  theme(legend.position = c(0.2, 0.80),
        legend.title = element_blank())

Italy, Spain, Greece

Code
PCPIH_IX %>%
  filter(REF_AREA %in% c("IT", "ES", "GR"),
         FREQ == "A") %>%
  year_to_date2() %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  filter(!is.na(OBS_VALUE)) %>%
  ggplot(.) + theme_minimal() + xlab("") + ylab("") +
  geom_line(aes(x = date, y = OBS_VALUE, color = Ref_area, linetype = Ref_area)) + 
  scale_x_date(breaks = seq(1950, 2020, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  scale_y_log10(breaks = c(seq(1, 5, 1), seq(0, 200, 10)),
                     labels = dollar_format(accuracy = 1, prefix = "")) +
  scale_color_manual(values = viridis(5)[1:4]) +
  theme(legend.position = c(0.2, 0.80),
        legend.title = element_blank())

Japan, Norway, Portugal

Code
PCPIH_IX %>%
  filter(REF_AREA %in% c("PT", "JP", "NO"),
         FREQ == "A") %>%
  year_to_date2() %>%
  left_join(REF_AREA, by = "REF_AREA") %>%
  filter(!is.na(OBS_VALUE)) %>%
  ggplot(.) + theme_minimal() + xlab("") + ylab("") +
  geom_line(aes(x = date, y = OBS_VALUE, color = Ref_area, linetype = Ref_area)) + 
  scale_x_date(breaks = seq(1950, 2020, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  scale_y_log10(breaks = c(seq(1, 5, 1), seq(0, 200, 10)),
                     labels = dollar_format(accuracy = 1, prefix = "")) +
  scale_color_manual(values = viridis(5)[1:4]) +
  theme(legend.position = c(0.2, 0.80),
        legend.title = element_blank())