GDP per unit of energy use (constant 2017 PPP $ per kg of oil equivalent)

Data - WDI

Nobs - Javascript

Code
EG.GDP.PUSE.KO.PP.KD |>
  left_join(iso2c, by = "iso2c") |>
  group_by(iso2c, Iso2c) |>
  mutate(value = round(value, 2)) |>
  summarise(Nobs = n(),
            `Year 1` = first(year),
            `GDP per unit of energy use 1` = first(value),
            `Year 2` = last(year),
            `GDP per unit of energy use 2` = last(value)) |>
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

France, Germany, Italy

Code
EG.GDP.PUSE.KO.PP.KD |>
  filter(iso2c %in% c("IT", "FR", "DE")) |>
  left_join(iso2c, by = "iso2c") |>
  year_to_enddate() |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  ggplot() + theme_minimal() + geom_line() + 
  aes(x = date, y = value, color = color) +
  xlab("") + ylab("GDP per unit of energy use") +
  scale_color_identity() + add_flags +
  theme(legend.title = element_blank(),
        legend.position = c(0.8, 0.9)) +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = seq(-60, 100, 2))

Japan, Switzerland

Code
EG.GDP.PUSE.KO.PP.KD |>
  filter(iso2c %in% c("JP", "CH")) |>
  left_join(iso2c, by = "iso2c") |>
  year_to_enddate() |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  ggplot() + theme_minimal() + geom_line() + 
  aes(x = date, y = value, color = color) +
  xlab("") + ylab("GDP per unit of energy use") +
  scale_color_identity() + add_flags +
  theme(legend.title = element_blank(),
        legend.position = c(0.2, 0.9)) +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = seq(-60, 100, 2))

China, United States

Code
EG.GDP.PUSE.KO.PP.KD |>
  filter(iso2c %in% c("CN", "US")) |>
  left_join(iso2c, by = "iso2c") |>
  year_to_enddate() |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  ggplot() + theme_minimal() + geom_line() + 
  aes(x = date, y = value, color = color) +
  xlab("") + ylab("GDP per unit of energy use") +
  scale_color_identity() + add_flags +
  theme(legend.title = element_blank(),
        legend.position = c(0.2, 0.9)) +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = seq(-60, 100, 2))

China, France, Germany

Code
EG.GDP.PUSE.KO.PP.KD |>
  filter(iso2c %in% c("CN", "FR", "DE")) |>
  left_join(iso2c, by = "iso2c") |>
  year_to_enddate() |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  ggplot() + theme_minimal() + geom_line() + 
  aes(x = date, y = value, color = color) +
  xlab("") + ylab("GDP per unit of energy use") +
  scale_color_identity() + add_flags +
  theme(legend.title = element_blank(),
        legend.position = c(0.2, 0.9)) +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = seq(-60, 100, 2))

Spain, United Kingdom, United States

Code
EG.GDP.PUSE.KO.PP.KD |>
  filter(iso2c %in% c("US", "GB", "ES")) |>
  left_join(iso2c, by = "iso2c") |>
  year_to_enddate() |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  ggplot() + theme_minimal() + geom_line() + 
  aes(x = date, y = value, color = color) +
  xlab("") + ylab("GDP per unit of energy use") +
  scale_color_identity() + add_flags +
  theme(legend.title = element_blank(),
        legend.position = c(0.2, 0.9)) +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = seq(-60, 100, 2))

Argentina, Chile, Venezuela

Code
EG.GDP.PUSE.KO.PP.KD |>
  filter(iso2c %in% c("AR", "CL", "VE")) |>
  left_join(iso2c, by = "iso2c") |>
  year_to_enddate() |>
  mutate(Iso2c = ifelse(iso2c == "VE", "Venezuela", Iso2c)) |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  ggplot() + theme_minimal() + geom_line() + 
  aes(x = date, y = value, color = color) +
  xlab("") + ylab("GDP per unit of energy use") +
  scale_color_identity() + add_flags +
  theme(legend.title = element_blank(),
        legend.position = c(0.2, 0.9)) +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = seq(-60, 100, 1))

Greece, Hong Kong, Mexico

Code
EG.GDP.PUSE.KO.PP.KD |>
  filter(iso2c %in% c("GR", "HK", "MX")) |>
  left_join(iso2c, by = "iso2c") |>
  year_to_enddate() |>
  mutate(Iso2c = ifelse(iso2c == "HK", "Hong Kong", Iso2c)) |>
  left_join(colors, by = c("Iso2c" = "country")) |>
  ggplot() + theme_minimal() + geom_line() + 
  aes(x = date, y = value, color = color) +
  xlab("") + ylab("GDP per unit of energy use") +
  scale_color_identity() + add_flags +
  theme(legend.title = element_blank(),
        legend.position = c(0.2, 0.9)) +
  scale_x_date(breaks = seq(1950, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  scale_y_continuous(breaks = seq(-60, 100, 2))