Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • twr1m15/fridayFagPackets
  • ba1e12/fridayFagPackets
  • SERG/fridayFagPackets
3 results
Show changes
Commits on Source (36)
# fridayFagPackets
A repo for our [fridayFagPacket](https://energy.soton.ac.uk/friday-fag-packets/) data notes (numbers that could have been done on the back of one and should probably come with a similar health warning).
A repo for our [fridayFagPacket](https://dataknut.github.io/fridayFagPackets/) data notes (numbers that could have been done on the back of one and should probably come with a similar health warning).
* docs - where we (usually) keep outputs - these are published on [energy.soton](https://energy.soton.ac.uk/friday-fag-packets/)
The repo is auto-mirrored from https://git.soton.ac.uk/SERG/fridayFagPackets (where we do the work) to https://github.com/dataknut/fridayFagPackets
* docs - where we (usually) keep outputs - these are published on:
* github [pages](https://dataknut.github.io/fridayFagPackets/)
* and some of them are also at [energy.soton](https://energy.soton.ac.uk/friday-fag-packets/) in a more refined form :-)
* data - where we keep (public) data we used
* R - where we keep useful R code for use across the repo
This diff is collapsed.
......@@ -2,7 +2,7 @@
A repo for our [fridayFagPacket](https://energy.soton.ac.uk/friday-fag-packets/) data notes (numbers that could have been done on the back of one and should probably come with a similar health warning)
* 2022-10-06 - [GDP & emissions - degrowthing or decoupling?](UK_GDP_emissions.html)
* 2022-10-06 - [GDP & emissions - degrowthing or decoupling?](GDP_emissions_trends.html)
* 2020-10-16 - [retrofit or bust](retrofitOrBust.html)
* 2018-06-15 - [UK household power demand and #worldcup2018](https://energy.soton.ac.uk/uk-household-power-demand-and-worldcup2018/)
* 2018-05-30 - [Super Saturday and spikes in demand](https://energy.soton.ac.uk/super-saturday-and-spikes-in-demand/)
......
This diff is collapsed.
---
title: "GDP & emissions - degrowthing or decoupling?"
author: "Ben Anderson & Tom Rushby"
date: "2022-10-06"
date-modified: "`r Sys.time()`"
date: "`r Sys.time()`"
format:
html:
self-contained: true
......@@ -18,134 +17,252 @@ editor: visual
library(data.table)
library(here)
library(ggplot2)
library(kableExtra)
library(plotly)
library(skimr)
figCaption <- "Plots by: @dataknut & @tom_rushby\nData source: Our World In Data (https://ourworldindata.org/grapher/co2-emissions-and-gdp)"
```
# Friday fagpackets
One of a [series](https://dataknut.github.io/fridayFagPackets/)...
# What's all this about de-growth?
\<sigh\>
A follow-up to [\@tom_rushby's tweet](https://twitter.com/tom_rushby/status/1577752402798821410)
Updated after [another by \@JKSteinberger](https://twitter.com/JKSteinberger/status/1587562447795167233)
# Data
Downloaded from the awesome [OurWorldInData](https://ourworldindata.org/grapher/co2-emissions-and-gdp?country=~GBR).
Downloaded from the awesome [OurWorldInData](https://ourworldindata.org/grapher/co2-emissions-and-gdp?country=~OWID_WRL):
- absolute and per capita GDP
- absolute and per capita Greenhouse Gas emissions in two flavours:
- production ('territorial') and
- consumption
```{r}
#| label: loasdData
# fix
dt_abs <- data.table::fread(here::here("data", "co2-emissions-and-gdp.csv"))
dt_pc <- data.table::fread(here::here("data", "co2-emissions-and-gdp-per-capita.csv"))
```
Who do we care about?
Where do we care about?
> Change these at will and for your purposes...
>
> This would make a really nice [shiny app](https://shiny.rstudio.com/gallery/)
```{r}
#| label: selectEntities
entities_of_interest <- c("United Kingdom", "United States", "New Zealand", "China")
entities_of_interest <- c("United Kingdom", "United States", "New Zealand", "Australia",
"China", "India", "Norway", "Kenya", "Jamaica")
# check valid
t <- dt_pc[Entity %in% entities_of_interest, .(nObs = .N,
meanAnnualPerCapTerr = mean(`Annual CO2 emissions (per capita)`, na.rm = TRUE),
meanAnnualPerCapCons = mean(`Annual consumption-based CO2 emissions (per capita)`,na.rm = TRUE),
meanAnnualGDPperCap = mean(`GDP per capita, PPP (constant 2017 international $)`,na.rm = TRUE)), keyby = .(Entity)]
knitr::kable(t, digits = 2) %>%
kable_styling()
```
# Absolute GDP & emissions
First we'll try production emissions.
## Absolute production emissions
First we'll try production ('territorial') emissions. We are not controlling for population size so countries with large populations will visually dominate.
```{r}
#| label: fig-ukPlotProd
#| fig-cap: UK GDP vs production emissions over time.
#| label: fig-SelectedProdPlot
#| fig-cap: GDP vs production emissions over time (selected entities).
#| warning: false
plotDT <- dt_abs[Entity %in% entities_of_interest]
ggplot2::ggplot(plotDT, aes(y = as.numeric(`GDP, PPP (constant 2017 international $)`)/1000000000,
x = as.numeric(`Annual CO2 emissions`)/1000000,
ggplot2::ggplot(plotDT, aes(x = as.numeric(`GDP, PPP (constant 2017 international $)`)/1000000000,
y = as.numeric(`Annual CO2 emissions`)/1000000,
colour = Entity,
alpha = Year)) +
geom_point() +
labs(x = "Annual CO2 emissions (production-based, gT)",
y = "GDP $bn (constant 2017 $)")
labs(y = "Annual CO2 emissions (production-based, gT)",
x = "GDP $bn (constant 2017 $)",
caption = figCaption)
```
Next we'll try consumption emissions.
## Absolute consumption emissions
Note that 2020 consumption-based emissions data is missing so you don't see the downtick
Note that 2020 consumption-based emissions data is missing so you don't see the 2020 COVID-19 downtick. Absolute emissions are falling in some places even as GDP is still increasing...
```{r}
#| label: fig-ukPlotCons
#| fig-cap: UK GDP vs consumption emissions over time.
#| label: fig-SelectedConsPlot
#| fig-cap: GDP vs consumotion emissions over time (selected entities).
#| warning: false
plotDT <- dt_abs[Entity %in% entities_of_interest]
ggplot2::ggplot(plotDT, aes(y = as.numeric(`GDP, PPP (constant 2017 international $)`)/1000000000,
x = as.numeric(`Annual consumption-based CO2 emissions`)/1000000,
ggplot2::ggplot(plotDT, aes(x = as.numeric(`GDP, PPP (constant 2017 international $)`)/1000000000,
y = as.numeric(`Annual consumption-based CO2 emissions`)/1000000,
colour = Entity,
alpha = Year)) +
geom_point() +
labs(x = "Annual CO2 emissions (consumption-based, gT)",
y = "GDP $bn (constant 2017 $)")
labs(y = "Annual CO2 emissions (consumption-based, gT)",
x = "GDP $bn (constant 2017 $)",
caption = figCaption)
```
# Per capita GDP & emissions
Since we'll be dividing everything pairwise by the same denominator, nothing much should change... but the plots should be much clearer as we've removed the affect of population size
Since we'll be dividing everything pairwise by the same denominator, nothing much about the shapes should change... but the plots should be much clearer as we've removed the affect of population size. Countries with large populations will no longer visually dominate...
## Production emissions
First we'll try production emissions.
First we'll try production emissions. @fig-SelectedProdPlotPcc shows change in this metric over time. Some interesting changes in direction (and otherwise)... basically they all need to be inverse U shaped, i.e. heading for y = 0.
```{r}
#| label: fig-ukPlotProdPcc
#| fig-cap: UK GDP vs production emissions over time.
#| label: fig-SelectedProdPlotPcc
#| fig-cap: GDP vs production emissions over time (selected entities)
#| warning: false
entities_of_interest <- c(entities_of_interest, "World")
plotDT <- dt_pc[Entity %in% entities_of_interest]
ggplot2::ggplot(plotDT, aes(y = as.numeric(`GDP per capita, PPP (constant 2017 international $)`),
x = as.numeric(`Annual CO2 emissions (per capita)`),
p <-ggplot2::ggplot(plotDT, aes(x = as.numeric(`GDP per capita, PPP (constant 2017 international $)`),
y = as.numeric(`Annual CO2 emissions (per capita)`),
colour = Entity,
alpha = Year)) +
geom_point() +
geom_line() +
labs(y = "Annual CO2 emissions per capita (production-based, T)",
x = "GDP per capita (constant 2017 $)",
caption = figCaption)
p
```
Let's repeat that. Hover over the dots to see which is which. This is [plotly](https://plotly.com/ggplot2/) in action #YMMV.
```{r}
#| label: fig-SelectedProdPlotPccPlotyly
#| fig-cap: GDP vs production emissions over time (selected entities)
#| warning: false
p <-ggplot2::ggplot(plotDT, aes(x = as.numeric(`GDP per capita, PPP (constant 2017 international $)`),
y = as.numeric(`Annual CO2 emissions (per capita)`),
colour = Entity)) +
geom_point() +
geom_line() +
labs(y = "Annual CO2 emissions per capita (production-based, T)",
x = "GDP per capita (constant 2017 $)",
caption = figCaption)
plotly::ggplotly(p)
```
Now let's have a look at all the countries but without the lines.
Quite interesting, Qatar for example. Perfect place for a winter sport's World Cup. Trinidad and Tobago also worth a look. Macao looks like the place to be?
```{r}
#| label: fig-ProdPlotPcc
#| fig-cap: GDP vs production emissions over time (all entities)
#| warning: false
#plotDT <- dt_pc[Entity %in% entities_of_interest]
plotDT <- dt_pc # for fun
p <- ggplot2::ggplot(plotDT, aes(x = as.numeric(`GDP per capita, PPP (constant 2017 international $)`),
y = as.numeric(`Annual CO2 emissions (per capita)`),
colour = Entity,
alpha = Year)) +
geom_point() +
labs(x = "Annual CO2 emissions per capita (production-based, T)",
y = "GDP per capita (constant 2017 $)")
theme(legend.position = "none") +
labs(y = "Annual CO2 emissions per capita (production-based, T)",
x = "GDP per capita (constant 2017 $)",
caption = figCaption)
plotly::ggplotly(p)
```
Next we'll try consumption emissions.
## Consumption emissions
Next we'll try consumption emissions. This is shown in @fig-SelectedConsPlotPcc.
Note that 2020 consumption-based emissions data is missing so you don't see the downtick
Note that 2020 consumption-based emissions data is missing so you don't see the down-tick.
```{r}
#| label: fig-ukPlotConsPcc
#| fig-cap: UK GDP vs consumption emissions over time.
#| label: fig-SelectedConsPlotPcc
#| fig-cap: GDP vs consumption emissions over time (selected entities).
#| warning: false
plotDT <- dt_pc[Entity %in% entities_of_interest]
ggplot2::ggplot(plotDT, aes(y = as.numeric(`GDP per capita, PPP (constant 2017 international $)`),
x = as.numeric(`Annual consumption-based CO2 emissions (per capita)`),
ggplot2::ggplot(plotDT, aes(x = as.numeric(`GDP per capita, PPP (constant 2017 international $)`),
y = as.numeric(`Annual consumption-based CO2 emissions (per capita)`),
colour = Entity,
alpha = Year)) +
geom_point() +
geom_line() +
labs(y = "Annual CO2 emissions per capita (consumption-based, T)",
x = "GDP per capita (constant 2017 $)",
caption = figCaption)
```
Let's repeat that for all countries. Hover over the dots to see which is which #YMMV.
Well this time Luxembourg is out in the lead...
```{r}
#| label: fig-ConsPlotPcc
#| fig-cap: GDP vs consumption emissions over time (all entities)
#| warning: false
#plotDT <- dt_pc[Entity %in% entities_of_interest]
plotDT <- dt_pc # for fun
p <- ggplot2::ggplot(plotDT, aes(x = as.numeric(`GDP per capita, PPP (constant 2017 international $)`),
y = as.numeric(`Annual consumption-based CO2 emissions (per capita)`),
colour = Entity,
alpha = Year)) +
geom_point() +
labs(x = "Annual CO2 emissions per capita (consumption-based, T)",
y = "GDP per capita (constant 2017 $)")
theme(legend.position = "none") +
labs(y = "Annual CO2 emissions per capita (consumption-based, T)",
x = "GDP per capita (constant 2017 $)",
caption = figCaption)
plotly::ggplotly(p)
```
# Efficiency
How about looking at efficency gC02e per \$ GDP?
How about looking at efficiency: gC02e per \$ GDP?
Following <https://timjackson.org.uk/earth-vs-growth/> ...
```{r}
#| label: selectProduction
dt_abs[, `Emissions intensity` := `Annual CO2 emissions`/`GDP, PPP (constant 2017 international $)`*1000*1000]
entities_of_interest <- c("United Kingdom", "United States", "World", "New Zealand", "China")
dt_abs[, `Emissions intensity (production-based)` := `Annual CO2 emissions`/`GDP, PPP (constant 2017 international $)`*1000*1000]
```
```{r}
#| label: selectAndPlotProduction
plotDT <- dt_abs[Entity %in% entities_of_interest]
ggplot2::ggplot(plotDT, aes(Year, `Emissions intensity`, colour = Entity)) +
ggplot2::ggplot(plotDT, aes(Year, `Emissions intensity (production-based)`, colour = Entity)) +
geom_line() +
labs(y = "gC02 per $ GDP",
colour = "Country",
caption = "Data: https://ourworldindata.org")
caption = figCaption)
```
For the UK, let's say c. 300g/\$ in 1995 reducing to 200g/\$ in 2010. So 15 years. To go from 200g/\$ to zero at the same rate would take approx. 30 years. So net-zero by 2050?
......@@ -163,7 +280,8 @@ plotDT <- dt_abs[Entity %in% entities_of_interest]
ggplot2::ggplot(plotDT, aes(Year, `Emissions intensity (consumption-based)`, colour = Entity)) +
geom_line() +
labs(y = "gC02 per $ GDP")
labs(y = "gC02 per $ GDP",
caption = figCaption)
```
# Whom do we love?
......
# run quarto render
library(quarto)
quarto_render(input = here::here("gdpAndEmissions","GDP_emissions_trends.qmd")
)
# should not need this - render should be able to do it?
file.copy(from = here::here("gdpAndEmissions","GDP_emissions_trends.html"),
to = here::here("docs","GDP_emissions_trends.html"),overwrite = TRUE
)
\ No newline at end of file