Gas prices for household consumers - bi-annual data (from 2007 onwards)

Data - Eurostat

Info

source dataset .html .RData

eurostat

nrg_pc_202

2024-09-15 2024-09-18

Data on energy

source dataset .html .RData

ec

WOB

2024-09-15 2024-08-25

eurostat

ei_isen_m

2024-09-18 2024-09-14

eurostat

nrg_bal_c

2023-12-31 2024-09-15

eurostat

nrg_pc_202

2024-09-15 2024-09-18

eurostat

nrg_pc_203

2023-06-11 2024-09-18

eurostat

nrg_pc_203_c

2024-09-15 2024-09-15

eurostat

nrg_pc_203_h

2024-09-15 2024-09-15

eurostat

nrg_pc_203_v

2024-09-15 2024-09-18

eurostat

nrg_pc_204

2024-09-15 2024-09-15

eurostat

nrg_pc_205

2023-06-11 2024-09-18

fred

energy

2024-09-18 2024-09-18

iea

world_energy_balances_highlights_2022

2024-06-20 2023-04-24

wb

CMO

2024-06-20 2024-05-23

wdi

EG.GDP.PUSE.KO.PP.KD

2024-09-18 2024-09-18

wdi

EG.USE.PCAP.KG.OE

2024-09-18 2024-09-18

yahoo

energy

2024-09-18 2024-09-18

LAST_COMPILE

LAST_COMPILE
2024-09-19

Last

Code
nrg_pc_202 %>%
  group_by(time) %>%
  summarise(Nobs = n()) %>%
  arrange(desc(time)) %>%
  head(1) %>%
  print_table_conditional()
time Nobs
2023S2 1698

Info

  • Electricity and gas prices stabilise in 2023. html

  • Electricity and gas prices in the first half of 2022. html / png

Code
include_graphics("https://ec.europa.eu/eurostat/documents/4187653/14185664/Gas+and+Electricity+Prices+S1_2022.png")

nrg_cons

Code
nrg_pc_202 %>%
  left_join(nrg_cons, by = "nrg_cons") %>%
  group_by(nrg_cons, Nrg_cons) %>%
  summarise(Nobs = n()) %>%
  print_table_conditional()
nrg_cons Nrg_cons Nobs
GJ20-199 Consumption from 20 GJ to 199 GJ - band D2 17952
GJ_GE200 Consumption 200 GJ or over - band D3 17494
GJ_LT20 Consumption less than 20 GJ - band D1 17916
TOT_GJ Consumption of GJ - all bands 54

currency

Code
nrg_pc_202 %>%
  left_join(currency, by = "currency") %>%
  group_by(currency, Currency) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  print_table_conditional()
currency Currency Nobs
EUR Euro 18556
NAC National currency 17676
PPS Purchasing Power Standard 17184

tax

Code
nrg_pc_202 %>%
  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 17806
X_TAX Excluding taxes and levies 17805
X_VAT Excluding VAT and other recoverable taxes and levies 17805

unit

Code
nrg_pc_202 %>%
  left_join(unit, by = "unit") %>%
  group_by(unit, Unit) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  print_table_conditional()
unit Unit Nobs
KWH Kilowatt-hour 26709
GJ_GCV Gigajoule (gross calorific value - GCV) 26707

geo

Code
nrg_pc_202 %>%
  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

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

Band D1 : Consumption < 20 GJ

France, Germany, Italy, Spain

All

Code
nrg_pc_202 %>%
  filter(geo %in% c("FR", "DE", "IT", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         unit == "KWH",
         nrg_cons == "GJ_LT20",
         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, 2100, 2), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("Band D1 : Consumption < 20 GJ") +
  scale_y_log10(breaks = seq(0.02, 0.2, 0.01),
                labels = dollar_format(a = .01, pre = "", su = "€"))

2016-

Code
nrg_pc_202 %>%
  filter(geo %in% c("FR", "DE", "IT", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         unit == "KWH",
         nrg_cons == "GJ_LT20",
         currency == "EUR") %>%
  left_join(geo, by = "geo") %>%
  left_join(tax, by = "tax") %>%
  semester_to_date %>%
  filter(date >= as.Date("2016-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, 2100, 1), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("Band D1 : Consumption < 20 GJ") +
  scale_y_log10(breaks = seq(0.02, 0.2, 0.01),
                labels = dollar_format(a = .01, pre = "", su = "€"))

France, Germany, Europe, Spain

Bar

Code
nrg_pc_202 %>%
  filter(geo %in% c("FR", "DE", "EA", "ES"),
         nrg_cons == "GJ_LT20",
         currency == "EUR",
         unit == "KWH",
         time %in% c("2021S2", "2022S1", "2022S2", "2023S1")) %>%
  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, .05),
                labels = dollar_format(a = .01, pre = "", su = "€/kWh"),
                limits = c(0, 0.2))  +
  xlab("Semester") + ylab("") +
  ggtitle("Natural gas price, LOW Consumption")

All

Code
nrg_pc_202 %>%
  filter(geo %in% c("FR", "DE", "EA", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         unit == "KWH",
         nrg_cons == "GJ_LT20",
         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, 2100, 2), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("Band D1 : Consumption < 20 GJ") +
  scale_y_log10(breaks = seq(0.02, 0.2, 0.01),
                labels = dollar_format(a = .01, pre = "", su = "€"))

2016-

Code
nrg_pc_202 %>%
  filter(geo %in% c("FR", "DE", "EA", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         unit == "KWH",
         nrg_cons == "GJ_LT20",
         currency == "EUR") %>%
  left_join(geo, by = "geo") %>%
  left_join(tax, by = "tax") %>%
  semester_to_date %>%
  filter(date >= as.Date("2016-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, 2100, 1), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("Band D1 : Consumption < 20 GJ") +
  scale_y_log10(breaks = seq(0.02, 0.2, 0.01),
                labels = dollar_format(a = .01, pre = "", su = "€"))

2020-

Code
nrg_pc_202 %>%
  filter(geo %in% c("FR", "DE", "EA", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         unit == "KWH",
         nrg_cons == "GJ_LT20",
         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, 2100, 1), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("Band D1 : Consumption < 20 GJ") +
  scale_y_log10(breaks = seq(0.02, 0.2, 0.01),
                labels = dollar_format(a = .01, pre = "", su = "€"))

Greece, Belgium, Austria, Portugal

All

Code
nrg_pc_202 %>%
  filter(geo %in% c("EL", "BE", "AT", "PT"),
         tax %in% c("I_TAX", "X_TAX"),
         unit == "KWH",
         nrg_cons == "GJ_LT20",
         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, 2100, 2), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("Band D1 : Consumption < 20 GJ") +
  scale_y_log10(breaks = seq(0.02, 0.2, 0.01),
                labels = dollar_format(a = .01, pre = "", su = "€"))

2016-

Code
nrg_pc_202 %>%
  filter(geo %in% c("EL", "BE", "AT", "PT"),
         tax %in% c("I_TAX", "X_TAX"),
         unit == "KWH",
         nrg_cons == "GJ_LT20",
         currency == "EUR") %>%
  left_join(geo, by = "geo") %>%
  left_join(tax, by = "tax") %>%
  semester_to_date %>%
  filter(date >= as.Date("2016-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, 2100, 1), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("Band D1 : Consumption < 20 GJ") +
  scale_y_log10(breaks = seq(0.02, 0.2, 0.01),
                labels = dollar_format(a = .01, pre = "", su = "€"))

Band D2 : 20 GJ < Consumption < 200 GJ

France, Germany, Italy, Spain

All

Code
nrg_pc_202 %>%
  filter(geo %in% c("FR", "DE", "IT", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         unit == "KWH",
         nrg_cons == "GJ20-199",
         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, 2100, 2), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("20 GJ < Consumption < 200 GJ") +
  scale_y_log10(breaks = seq(0.02, 0.12, 0.01),
                labels = dollar_format(a = .01, pre = "", su = "€"))

2016-

Code
nrg_pc_202 %>%
  filter(geo %in% c("FR", "DE", "IT", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         unit == "KWH",
         nrg_cons == "GJ20-199",
         currency == "EUR") %>%
  left_join(geo, by = "geo") %>%
  left_join(tax, by = "tax") %>%
  semester_to_date %>%
  filter(date >= as.Date("2016-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, 2100, 1), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("20 GJ < Consumption < 200 GJ") +
  scale_y_log10(breaks = seq(0.02, 0.12, 0.01),
                labels = dollar_format(a = .01, pre = "", su = "€"))

Band D3 : Consumption > 200 GJ

France, Germany, Italy, Spain

All

Code
nrg_pc_202 %>%
  filter(geo %in% c("FR", "DE", "IT", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         unit == "KWH",
         nrg_cons == "GJ_GE200",
         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, 2100, 2), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("Consumption > 200 GJ") +
  scale_y_log10(breaks = seq(0.02, 0.12, 0.01),
                labels = dollar_format(a = .01, pre = "", su = "€"))

2016-

Code
nrg_pc_202 %>%
  filter(geo %in% c("FR", "DE", "IT", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         unit == "KWH",
         nrg_cons == "GJ_GE200",
         currency == "EUR") %>%
  left_join(geo, by = "geo") %>%
  left_join(tax, by = "tax") %>%
  semester_to_date %>%
  filter(date >= as.Date("2016-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, 2100, 1), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("Consumption > 200 GJ") +
  scale_y_log10(breaks = seq(0.02, 0.12, 0.01),
                labels = dollar_format(a = .01, pre = "", su = "€"))

2020-

Code
nrg_pc_202 %>%
  filter(geo %in% c("FR", "DE", "IT", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         unit == "KWH",
         nrg_cons == "GJ_GE200",
         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, 2100, 1), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("Consumption > 200 GJ") +
  scale_y_log10(breaks = seq(0.02, 0.12, 0.01),
                labels = dollar_format(a = .01, pre = "", su = "€"))

France, Germany, Europe, Spain

Bar

Code
nrg_pc_202 %>%
  filter(geo %in% c("FR", "DE", "EA", "ES"),
         nrg_cons == "GJ_GE200",
         currency == "EUR",
         unit == "KWH",
         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, .05),
                labels = dollar_format(a = .01, pre = "", su = "€/kWh"))  +
  xlab("") + ylab("") +
  ggtitle("Natural gas price, HIGH Consumption")

All

Code
nrg_pc_202 %>%
  filter(geo %in% c("FR", "DE", "EA", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         unit == "KWH",
         nrg_cons == "GJ_GE200",
         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, 2100, 2), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("Consumption > 200 GJ") +
  scale_y_log10(breaks = seq(0.02, 0.2, 0.01),
                labels = dollar_format(a = .01, pre = "", su = "€"))

2016-

Code
nrg_pc_202 %>%
  filter(geo %in% c("FR", "DE", "EA", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         unit == "KWH",
         nrg_cons == "GJ_GE200",
         currency == "EUR") %>%
  left_join(geo, by = "geo") %>%
  left_join(tax, by = "tax") %>%
  semester_to_date %>%
  filter(date >= as.Date("2016-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, 2100, 1), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("Consumption > 200 GJ") +
  scale_y_log10(breaks = seq(0.02, 0.2, 0.01),
                labels = dollar_format(a = .01, pre = "", su = "€"))

2020-

Code
nrg_pc_202 %>%
  filter(geo %in% c("FR", "DE", "EA", "ES"),
         tax %in% c("I_TAX", "X_TAX"),
         unit == "KWH",
         nrg_cons == "GJ_GE200",
         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, 2100, 1), "-01-01")),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.2, 0.9),
        legend.title = element_blank()) +
  xlab("") + ylab("Consumption > 200 GJ") +
  scale_y_log10(breaks = seq(0.02, 0.2, 0.01),
                labels = dollar_format(a = .01, pre = "", su = "€"))

Example

France

Code
nrg_pc_202 %>%
  filter(geo == "FR",
         unit == "KWH",
         currency == "EUR") %>%
  left_join(tax, by = "tax") %>%
  left_join(nrg_cons, by = "nrg_cons") %>%
  select_if(~ n_distinct(.) > 1) %>%
  semester_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = Nrg_cons, linetype = Tax)) +
  theme_minimal() + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1920, 2100, 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.7),
        legend.title = element_blank())

Germany

Code
nrg_pc_202 %>%
  filter(geo == "DE",
         unit == "KWH",
         currency == "EUR") %>%
  left_join(tax, by = "tax") %>%
  left_join(nrg_cons, by = "nrg_cons") %>%
  select_if(~ n_distinct(.) > 1) %>%
  semester_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = Nrg_cons, linetype = Tax)) +
  theme_minimal() + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1920, 2100, 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.7),
        legend.title = element_blank())

Italy

Code
nrg_pc_202 %>%
  filter(geo == "IT",
         unit == "KWH",
         currency == "EUR") %>%
  left_join(tax, by = "tax") %>%
  left_join(nrg_cons, by = "nrg_cons") %>%
  select_if(~ n_distinct(.) > 1) %>%
  semester_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = Nrg_cons, linetype = Tax)) +
  theme_minimal() + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1920, 2100, 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.7),
        legend.title = element_blank())

Spain

Code
nrg_pc_202 %>%
  filter(geo == "ES",
         unit == "KWH",
         currency == "EUR") %>%
  left_join(tax, by = "tax") %>%
  left_join(nrg_cons, by = "nrg_cons") %>%
  select_if(~ n_distinct(.) > 1) %>%
  semester_to_date %>%
  ggplot + geom_line(aes(x = date, y = values, color = Nrg_cons, linetype = Tax)) +
  theme_minimal() + xlab("") + ylab("") +
  scale_x_date(breaks = seq(1920, 2100, 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.7),
        legend.title = element_blank())