~/data/eurostat/

Info

LAST_COMPILE

LAST_COMPILE
2023-06-11

Last

nrg_pc_205 %>%
  group_by(time) %>%
  summarise(Nobs = n()) %>%
  arrange(desc(time)) %>%
  head(1) %>%
  print_table_conditional()
time Nobs
2022S2 2496

Info

  • Electricity and gas prices in the first half of 2022. html / png
include_graphics("https://ec.europa.eu/eurostat/documents/4187653/14185664/Gas+and+Electricity+Prices+S1_2022.png")

  • html

  • Electricity prices for household consumers, second half 2022. html

include_graphics("https://ec.europa.eu/eurostat/statistics-explained/images/7/7a/Electricity_prices_for_household_consumers%2C_second_half_2022_v5.png")

consom

nrg_pc_205 %>%
  left_join(consom, by = "consom") %>%
  group_by(consom, Consom) %>%
  summarise(Nobs = n()) %>%
  print_table_conditional()
consom Consom Nobs
4162901 Band IA : Consumption < 20 MWh 10008
4162902 Band IB : 20 MWh < Consumption < 500 MWh 10002
4162903 Band IC : 500 MWh < Consumption < 2 000 MWh 10140
4162904 Band ID : 2 000 MWh < Consumption < 20 000 MWh 9990
4162905 Band IE : 20 000 MWh < Consumption < 70 000 MWh 9792
4162906 Band IF : 70 000 MWh < Consumption < 150 000 MWh 9225
4162907 Band IG : Consumption > 150 000 MWh 5550
TOT_KWH Consumption of kWh - all bands 864

currency

nrg_pc_205 %>%
  left_join(currency, by = "currency") %>%
  group_by(currency, Currency) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  print_table_conditional()
currency Currency Nobs
EUR Euro 22690
NAC National currency 21685
PPS Purchasing Power Standard 21196

tax

nrg_pc_205 %>%
  left_join(tax, by = "tax") %>%
  group_by(tax, Tax) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  print_table_conditional()
tax Tax Nobs
I_TAX All taxes and levies included 21892
X_VAT Excluding VAT and other recoverable taxes and levies 21892
X_TAX Excluding taxes and levies 21787

geo

nrg_pc_205 %>%
  left_join(geo, by = "geo") %>%
  group_by(geo, Geo) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  mutate(Geo = ifelse(geo == "DE", "Germany", Geo)) %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(Geo)),
         Flag = paste0('<img src="../../bib/flags/vsmall/', Flag, '.png" alt="Flag">')) %>%
  select(Flag, everything()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}

time

nrg_pc_205 %>%
  group_by(time) %>%
  summarise(Nobs = n()) %>%
  arrange(desc(time)) %>%
  print_table_conditional()

Consumption < 1 000 kWh

bars

nrg_pc_205 %>%
  filter(geo %in% c("FR", "DE", "EA", "ES"),
         consom == "4162901",
         currency == "EUR",
         time %in% c("2021S2", "2022S1", "2022S2")) %>%
  select_if(~n_distinct(.) > 1) %>%
  left_join(geo, by = "geo") %>%
  mutate(Geo = ifelse(geo == "EA", "Europe", Geo)) %>%
  spread(tax, values) %>%
  transmute(time, Geo,
            ` Taxes except VAT` = X_VAT-X_TAX,
            `  VAT` = I_TAX-X_VAT,
            `Excluding taxes` = X_TAX) %>%
  gather(Tax, values, - time, -Geo) %>%
  ggplot(., aes(x = time, y = values, fill = Tax)) + 
  geom_bar(stat = "identity",
           position = "stack") +
  facet_grid(~ Geo) + theme_minimal() +
theme(legend.position = c(0.2, 0.9),
      legend.title = element_blank()) +
  scale_fill_manual(values = viridis(3)[1:3]) +
  scale_y_continuous(breaks = seq(-30, 30, .1),
                labels = dollar_format(a = .1, pre = "", su = "€/kWh"),
                limits = c(0, 0.6))  +
  xlab("Semester") + ylab("") +
  ggtitle("Electricity price, LOW Consumption")

France, Germany, EA19, Spain

All

nrg_pc_205 %>%
  filter(geo %in% c("FR", "DE", "EA", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         consom == "4162901",
         currency == "EUR") %>%
  left_join(geo, by = "geo") %>%
  left_join(tax, by = "tax") %>%
  semester_to_date %>%
  mutate(Geo = ifelse(geo == "EA", "Europe", Geo)) %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  ggplot + geom_line(aes(x = date, y = values, color = color, linetype = Tax)) +
  scale_color_identity() + theme_minimal()  + add_8flags +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2025, 2), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.8),
        legend.title = element_blank()) +
  xlab("") + ylab("Electricity Prices - C < 1 000 kWh") +
  scale_y_log10(breaks = seq(-30, 30, .1),
                labels = dollar_format(a = .1, pre = "", su = "€"))

2020-

nrg_pc_205 %>%
  filter(geo %in% c("FR", "DE", "EA", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         consom == "4162901",
         currency == "EUR") %>%
  left_join(geo, by = "geo") %>%
  left_join(tax, by = "tax") %>%
  semester_to_date %>%
  filter(date >= as.Date("2020-01-01")) %>%
  mutate(Geo = ifelse(geo == "EA", "Europe", Geo)) %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  ggplot + geom_line(aes(x = date, y = values, color = color, linetype = Tax)) +
  scale_color_identity() + theme_minimal()  + add_8flags +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2025, 1), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.8),
        legend.title = element_blank()) +
  xlab("") + ylab("Band DA : Consumption < 1 000 kWh") +
  scale_y_log10(breaks = seq(-30, 30, .1),
                labels = dollar_format(a = .1, pre = "", su = "€"))

France, Germany, Italy, Spain

nrg_pc_205 %>%
  filter(geo %in% c("FR", "DE", "IT", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         consom == "4162901",
         currency == "EUR") %>%
  left_join(geo, by = "geo") %>%
  left_join(tax, by = "tax") %>%
  semester_to_date %>%
  filter(date >= as.Date("2020-01-01")) %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  ggplot + geom_line(aes(x = date, y = values, color = color, linetype = Tax)) +
  scale_color_identity() + theme_minimal()  + add_8flags +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2025, 1), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.8),
        legend.title = element_blank()) +
  xlab("") + ylab("Electricity Prices - C < 1 000 kWh") +
  scale_y_log10(breaks = seq(-30, 30, .1),
                labels = dollar_format(a = .1, pre = "", su = "€"))

Netherlands

nrg_pc_205 %>%
  filter(geo %in% c("NL"),
         tax %in% c("I_TAX", "X_TAX"),
         consom == "4162901",
         currency == "EUR") %>%
  left_join(geo, by = "geo") %>%
  left_join(tax, by = "tax") %>%
  semester_to_date %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  ggplot + geom_line(aes(x = date, y = values, color = color, linetype = Tax)) +
  scale_color_identity() + theme_minimal()  + add_2flags +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2025, 2), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.3),
        legend.title = element_blank()) +
  xlab("") + ylab("Electricity Prices - C < 1 000 kWh") +
  scale_y_continuous(breaks = seq(-30, 30, .1),
                labels = dollar_format(a = .1, pre = "", su = "€"))

Greece, Belgium, Austria, Portugal

nrg_pc_205 %>%
  filter(geo %in% c("EL", "BE", "AT", "PT"),
         tax %in% c("I_TAX", "X_TAX"),
         consom == "4162901",
         currency == "EUR") %>%
  left_join(geo, by = "geo") %>%
  left_join(tax, by = "tax") %>%
  semester_to_date %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  ggplot + geom_line(aes(x = date, y = values, color = color, linetype = Tax)) +
  scale_color_identity() + theme_minimal()  + add_8flags +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2025, 2), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("Electricity Prices - C < 1 000 kWh") +
  scale_y_log10(breaks = seq(-30, 30, .1),
                labels = dollar_format(a = .1, pre = "", su = "€"))

1 000 kWh < Consumption < 2 500 kWh

France, Germany, Italy, Spain

nrg_pc_205 %>%
  filter(geo %in% c("FR", "DE", "IT", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         consom == "4162902",
         currency == "EUR") %>%
  left_join(geo, by = "geo") %>%
  left_join(tax, by = "tax") %>%
  semester_to_date %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  ggplot + geom_line(aes(x = date, y = values, color = color, linetype = Tax)) +
  scale_color_identity() + theme_minimal()  + add_8flags +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2025, 2), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("Electricity Prices - 1 000 kWh < C < 2 500 kWh") +
  scale_y_log10(breaks = c(0.12, 0.15, 0.18, 0.2, 0.25, 0.3, 0.35),
                labels = dollar_format(a = .01, pre = "", su = "€"))

Band DE : Consumption > 15 000 kWh

France, Germany, EA19, Spain

bars

nrg_pc_205 %>%
  filter(geo %in% c("FR", "DE", "EA", "ES"),
         consom == "4162907",
         currency == "EUR",
         time %in% c("2021S2", "2022S1", "2022S2")) %>%
  select_if(~n_distinct(.) > 1) %>%
  left_join(geo, by = "geo") %>%
  mutate(Geo = ifelse(geo == "EA", "Europe", Geo)) %>%
  spread(tax, values) %>%
  transmute(time, Geo,
            ` Taxes except VAT` = X_VAT-X_TAX,
            `  VAT` = I_TAX-X_VAT,
            `Excluding taxes` = X_TAX) %>%
  gather(Tax, values, - time, -Geo) %>%
  ggplot(., aes(x = time, y = values, fill = Tax)) + 
  geom_bar(stat = "identity",
           position = "stack") +
  facet_grid(~ Geo) + theme_minimal() +
theme(legend.position = "none",
      legend.title = element_blank()) +
  scale_fill_manual(values = viridis(3)[1:3]) +
  scale_y_continuous(breaks = seq(-30, 30, .1),
                labels = dollar_format(a = .1, pre = "", su = "€/kWh"),
                limits = c(0, 0.6))  +
  xlab("Semester") + ylab("") +
  ggtitle("Electricity price, HIGH Consumption")

2020-

nrg_pc_205 %>%
  filter(geo %in% c("FR", "DE", "EA", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         consom == "4162907",
         currency == "EUR") %>%
  left_join(geo, by = "geo") %>%
  left_join(tax, by = "tax") %>%
  semester_to_date %>%
  filter(date >= as.Date("2020-01-01")) %>%
  mutate(Geo = ifelse(geo == "EA", "Europe", Geo)) %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  ggplot + geom_line(aes(x = date, y = values, color = color, linetype = Tax)) +
  scale_color_identity() + theme_minimal()  + add_8flags +
  scale_x_date(breaks = as.Date(paste0(seq(1960, 2025, 1), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.8),
        legend.title = element_blank()) +
  xlab("") + ylab("Band DE : Consumption > 15 000 kWh") +
  scale_y_log10(breaks = seq(-30, 30, .05),
                labels = dollar_format(a = .01, pre = "", su = "€"))

Euros

Euro Area EA

All

nrg_pc_205 %>%
  filter(geo == "EA",
         currency == "EUR") %>%
  left_join(tax, by = "tax") %>%
  left_join(consom, by = "consom") %>%
  select_if(~ n_distinct(.) > 1) %>%
  semester_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = paste0(Tax, " - ", Consom))) +
  theme_minimal() + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 1, 0.01)) +
  theme(legend.position = c(0.45, 0.5),
        legend.title = element_blank(),
        legend.text = element_text(size = 8),
        legend.key.size = unit(0.9, 'lines'))

2020-

nrg_pc_205 %>%
  filter(geo == "EA",
         currency == "EUR") %>%
  left_join(tax, by = "tax") %>%
  left_join(consom, by = "consom") %>%
  select_if(~ n_distinct(.) > 1) %>%
  semester_to_date %>%
  filter(date >= as.Date("2020-01-01")) %>%
  ggplot + geom_line(aes(x = date, y = values, color = paste0(Tax, " - ", Consom))) +
  theme_minimal() + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1920, 2025, 1) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 1, 0.01)) +
  theme(legend.position = c(0.45, 0.5),
        legend.title = element_blank(),
        legend.text = element_text(size = 8),
        legend.key.size = unit(0.9, 'lines'))

France

All

nrg_pc_205 %>%
  filter(geo == "FR",
         currency == "EUR") %>%
  left_join(tax, by = "tax") %>%
  left_join(consom, by = "consom") %>%
  select_if(~ n_distinct(.) > 1) %>%
  semester_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = Consom, linetype = Tax)) +
  theme_minimal() + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 1, 0.01)) +
  theme(legend.position = c(0.45, 0.5),
        legend.title = element_blank(),
        legend.text = element_text(size = 8),
        legend.key.size = unit(0.9, 'lines'))

2020-

nrg_pc_205 %>%
  filter(geo == "FR",
         currency == "EUR") %>%
  left_join(tax, by = "tax") %>%
  left_join(consom, by = "consom") %>%
  select_if(~ n_distinct(.) > 1) %>%
  semester_to_date %>%
  filter(date >= as.Date("2020-01-01")) %>%
  ggplot + geom_line(aes(x = date, y = values, color = paste0(Tax, " - ", Consom))) +
  theme_minimal() + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 1, 0.01)) +
  theme(legend.position = c(0.45, 0.5),
        legend.title = element_blank(),
        legend.text = element_text(size = 8),
        legend.key.size = unit(0.9, 'lines'))

Germany

nrg_pc_205 %>%
  filter(geo == "DE",
         unit == "KWH",
         currency == "EUR") %>%
  left_join(tax, by = "tax") %>%
  left_join(consom, by = "consom") %>%
  select_if(~ n_distinct(.) > 1) %>%
  semester_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = paste0(Tax, " - ", Consom))) +
  theme_minimal() + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 1, 0.01)) +
  theme(legend.position = c(0.45, 0.5),
        legend.title = element_blank(),
        legend.text = element_text(size = 8),
        legend.key.size = unit(0.9, 'lines'))

Italy

nrg_pc_205 %>%
  filter(geo == "IT",
         unit == "KWH",
         currency == "EUR") %>%
  left_join(tax, by = "tax") %>%
  left_join(consom, by = "consom") %>%
  select_if(~ n_distinct(.) > 1) %>%
  semester_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = paste0(Tax, " - ", Consom))) +
  theme_minimal() + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 1, 0.01)) +
  theme(legend.position = c(0.45, 0.5),
        legend.title = element_blank(),
        legend.text = element_text(size = 8),
        legend.key.size = unit(0.9, 'lines'))

Spain

nrg_pc_205 %>%
  filter(geo == "ES",
         currency == "EUR") %>%
  left_join(tax, by = "tax") %>%
  left_join(consom, by = "consom") %>%
  select_if(~ n_distinct(.) > 1) %>%
  semester_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = paste0(Tax, " - ", Consom))) +
  theme_minimal() + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 1, 0.01)) +
  theme(legend.position = c(0.45, 0.5),
        legend.title = element_blank(),
        legend.text = element_text(size = 8),
        legend.key.size = unit(0.9, 'lines'))

Netherlands

nrg_pc_205 %>%
  filter(geo == "NL",
         currency == "EUR") %>%
  left_join(tax, by = "tax") %>%
  left_join(consom, by = "consom") %>%
  select_if(~ n_distinct(.) > 1) %>%
  semester_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = paste0(Tax, " - ", Consom))) +
  theme_minimal() + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1920, 2025, 2) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  scale_y_log10(breaks = seq(0, 1, 0.01)) +
  theme(legend.position = c(0.45, 0.5),
        legend.title = element_blank(),
        legend.text = element_text(size = 8),
        legend.key.size = unit(0.9, 'lines'))