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 (94)
Showing
with 41781 additions and 5053 deletions
This diff is collapsed.
This diff is collapsed.
......@@ -7,19 +7,26 @@ makeReport <- function(f){
output_file = paste0(here::here("docs/"), f, ".html")
)
# word
rmarkdown::render(input = paste0(here::here("EPCsAndCarbon", f), ".Rmd"),
params = list(title = title,
subtitle = subtitle,
authors = authors),
output_file = paste0(here::here("docs/"), f, ".docx"),
output_format = "word_document"
)
# rmarkdown::render(input = paste0(here::here("EPCsAndCarbon", f), ".Rmd"),
# params = list(title = title,
# subtitle = subtitle,
# authors = authors),
# output_file = paste0(here::here("docs/"), f, ".docx"),
# output_format = "word_document"
# )
}
# >> run report ----
# >> run EPC data check & save data ----
rmdFile <- "epcChecks" # not the full path
title = "Checking EPC datasets for Southampton"
subtitle = "Data cleaning, outlier checks and coverage analysis"
authors = "Ben Anderson"
makeReport(rmdFile)
# >> run the report ----
rmdFile <- "carbonCosts" # not the full path
title = "What can EPC data tell us about the domestic cost of carbon?"
subtitle = ""
title = "Exploring #backOfaFagPacket scenarios for a residential dwellings Carbon Tax"
subtitle = "Southampton as a case study"
authors = "Ben Anderson"
makeReport(rmdFile)
\ No newline at end of file
makeReport(rmdFile)
# useful functions
# use source(here::here("R", "functions.R")) to load
require(flextable) # use require so it fails if not present & can't install
makeFlexTable <- function(df, cap = "caption"){
# makes a pretty flextable - see https://cran.r-project.org/web/packages/flextable/index.html
ft <- flextable::flextable(df)
ft <- flextable::colformat_double(ft, digits = 1)
ft <- flextable::fontsize(ft, size = 9)
ft <- flextable::fontsize(ft, size = 10, part = "header")
ft <- flextable::set_caption(ft, caption = cap)
return(flextable::autofit(ft))
}
\ No newline at end of file
# fridayFagPackets
A repo for our fridayFagPacket 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).
> git.soton does not support pages so for best viewing try [github](https://dataknut.github.io/fridayFagPackets/).
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 keep outputs
* 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
\ No newline at end of file
* R - where we keep useful R code for use across the repo
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
MSOA11CD,MSOA11NM,MSOACode,MSOAName,nEPCs,sumEPC_tCO2,n_epcIsSocialRent,n_epcIsPrivateRent,n_epcIsOwnerOcc,n_epcIsUnknownTenure,sumEpcMWh,nHHs_tenure,socRent_pc,privRent_pc,ownerOcc_pc,nHHs_deprivation,dep0_pc,dep1_pc,dep2_pc,dep3_pc,dep4_pc,LAName,nGasMeters,beisGasMWh,nElecMeters,beisElecMWh,i.LAName,beisEnergyMWh
E02003549,Southampton 001,E02003549,Southampton 001,1737,7361.5,156,502,966,49,41619.533339,2849,11.2320112320112,25.0614250614251,62.0568620568621,2849,52.3692523692524,32.8887328887329,12.2499122499123,2.31660231660232,0.175500175500176,Southampton,2557,38480.92752,2832,11196.00524,Southampton,49676.93276
E02003550,Southampton 002,E02003550,Southampton 002,1932,6448.3,434,288,1093,79,36605.553489,3216,21.0509950248756,11.0385572139303,66.0758706467662,3216,43.0970149253731,32.9291044776119,18.1902985074627,5.25497512437811,0.528606965174129,Southampton,2876,28049.7336,3527,13074.44004,Southampton,41124.17364
E02003551,Southampton 003,E02003551,Southampton 003,1456,4749.4,587,274,512,47,27395.685632,2256,38.9627659574468,15.2925531914894,42.9521276595745,2256,33.6879432624114,33.9982269503546,23.0053191489362,8.28900709219858,1.01950354609929,Southampton,1649,17358.86876,2446,8957.742376,Southampton,26316.611136
E02003552,Southampton 004,E02003552,Southampton 004,1653,5254.3,771,182,644,4,30104.336464,2646,47.4678760393046,9.25925925925926,40.9674981103553,2646,28.1179138321996,32.010582010582,29.2894935752079,9.90173847316705,0.680272108843537,Southampton,2009,17667.11557,2809,10383.88947,Southampton,28051.00504
E02003553,Southampton 005,E02003553,Southampton 005,1687,5658,290,820,483,41,31991.627421,2394,25.4385964912281,40.2673350041771,31.9966583124478,2394,39.0142021720969,32.9573934837093,19.8830409356725,6.97577276524645,1.16959064327485,Southampton,2303,24996.91283,2464,8479.992667,Southampton,33476.905497
E02003554,Southampton 006,E02003554,Southampton 006,1684,6260.8,249,455,893,43,35570.197615,2646,14.5502645502646,21.0506424792139,63.0007558578987,2646,46.4852607709751,32.3885109599395,17.2713529856387,3.51473922902494,0.340136054421769,Southampton,2378,29664.70715,2873,10048.0605,Southampton,39712.76765
E02003555,Southampton 007,E02003555,Southampton 007,2261,6179.1,540,244,1085,130,35181.898286,3140,30.9554140127389,11.1464968152866,56.1464968152866,3140,34.5859872611465,33.9171974522293,23.6624203821656,7.26114649681529,0.573248407643312,Southampton,2989,27670.86288,3763,12745.97142,Southampton,40416.8343
E02003556,Southampton 008,E02003556,Southampton 008,1339,4978.1,194,283,776,5,28093.9338712,2471,12.5050586806961,16.1473087818697,70.4168352893565,2471,42.5738567381627,34.5204370700121,17.5637393767705,4.49210845811412,0.84985835694051,Southampton,2295,26412.36043,2589,9199.673127,Southampton,35612.033557
E02003557,Southampton 009,E02003557,Southampton 009,2137,8330.9,122,979,920,10,47067.974377,2753,7.37377406465674,38.9756629131856,52.4881946966945,2753,50.7809662186705,33.0185252451871,13.4398837631675,2.57900472212132,0.181620050853614,Southampton,2354,32057.76788,3103,10784.46184,Southampton,42842.22972
E02003558,Southampton 010,E02003558,Southampton 010,2223,6686.5,641,612,756,91,38565.5508412,2924,32.3187414500684,25.8207934336525,39.8084815321477,2924,33.9603283173735,34.5075239398085,23.6320109439124,7.11354309165527,0.786593707250342,Southampton,2294,23530.15475,3222,10891.83831,Southampton,34421.99306
E02003559,Southampton 011,E02003559,Southampton 011,1678,7519.8,97,350,1176,13,42376.725845,3065,5.97063621533442,15.1386623164763,76.7047308319739,3065,53.3768352365416,30.3425774877651,13.768352365416,2.25122349102773,0.261011419249592,Southampton,2896,44023.67581,3165,11232.52733,Southampton,55256.20314
E02003560,Southampton 012,E02003560,Southampton 012,1952,5936.8,1046,168,670,43,33862.758635,3040,53.5197368421053,8.75,36.1184210526316,3040,26.9736842105263,34.4407894736842,27.796052631579,9.83552631578947,0.953947368421053,Southampton,2739,23190.35064,3191,11062.59208,Southampton,34252.94272
E02003561,Southampton 013,E02003561,Southampton 013,2663,8648.9,366,1207,888,58,49231.805891,3181,19.6793461175731,44.7343602640679,33.9830242062245,3181,39.7988054071047,32.945614586608,19.993712668972,6.13014775227916,1.13171958503615,Southampton,2473,26452.24976,3489,11978.59833,Southampton,38430.84809
E02003562,Southampton 014,E02003562,Southampton 014,2513,8291.7,208,787,1353,98,47128.063564,3636,9.13091309130913,29.2354235423542,59.1859185918592,3636,45.6820682068207,33.5808580858086,15.8690869086909,4.26292629262926,0.605060506050605,Southampton,2983,36532.47894,3921,14757.18363,Southampton,51289.66257
E02003563,Southampton 015,E02003563,Southampton 015,2553,8109.2,640,607,1082,163,46524.5676513,3483,21.7915590008613,24.1745621590583,51.7944300890037,3483,37.8122308354867,33.4194659776055,22.0499569336779,6.00057421762848,0.717772035601493,Southampton,2648,27516.54456,3818,12404.30615,Southampton,39920.85071
E02003564,Southampton 016,E02003564,Southampton 016,2164,7628.6,521,300,1154,81,43679.630169,3474,22.5388601036269,12.0898100172712,63.3851468048359,3474,39.3782383419689,33.9666090961428,20.1496833621186,5.4691997697179,1.03626943005181,Southampton,2777,30545.17042,3563,13173.31465,Southampton,43718.48507
E02003565,Southampton 017,E02003565,Southampton 017,2427,7507.80000000001,180,1291,553,277,42637.781023,2563,11.6269996098322,57.2376121732345,28.950448692938,2563,48.8099882949668,31.4865392118611,14.3191572376122,4.52594615684745,0.858369098712446,Southampton,2241,25810.92458,2840,9380.707441,Southampton,35191.632021
E02003566,Southampton 018,E02003566,Southampton 018,1617,4850.4,470,170,755,8,27441.646901,2607,29.8427311085539,8.36210203298811,59.4169543536632,2607,35.2128883774453,33.8319907940161,24.741081703107,5.90717299578059,0.30686612965094,Southampton,2607,26826.21743,2831,9221.544436,Southampton,36047.761866
E02003567,Southampton 019,E02003567,Southampton 019,1780,5939.5,464,277,978,41,33255.3013728,2991,27.2818455366098,14.1089936476095,56.8037445670344,2991,39.1842193246406,32.7983951855567,20.193915078569,7.28853226345704,0.534938147776663,Southampton,3036,32188.32713,3200,11259.88083,Southampton,43448.20796
E02003568,Southampton 020,E02003568,Southampton 020,2959,9363.80000000001,120,1451,1203,51,53468.7626998,3820,4.52879581151833,50.9162303664922,42.9319371727749,3820,50.0785340314136,32.4083769633508,13.4816753926702,3.19371727748691,0.837696335078534,Southampton,2757,33366.33693,3900,13657.7525,Southampton,47024.08943
E02003569,Southampton 021,E02003569,Southampton 021,2754,8298.1,334,1073,1062,71,47718.629898,3527,14.9985823646158,38.2761553728381,44.3152821094415,3527,40.7144882336263,32.7190246668557,19.960306209243,5.92571590586901,0.680464984406011,Southampton,2722,27661.45348,3999,13719.21685,Southampton,41380.67033
E02003570,Southampton 022,E02003570,Southampton 022,3429,10185.1,828,1320,775,165,58338.870496,3635,29.8211829436039,45.6946354883081,22.585969738652,3635,25.5570839064649,35.3507565337001,26.0247592847318,11.4167812929849,1.65061898211829,Southampton,3083,34730.59843,4142,14719.37189,Southampton,49449.97032
E02003571,Southampton 023,E02003571,Southampton 023,2958,8206.1,368,1396,725,258,47820.533587,3040,20.2302631578947,56.9736842105263,21.4802631578947,3040,47.9605263157895,31.4473684210526,14.8355263157895,5.03289473684211,0.723684210526316,Southampton,1808,21269.29383,3530,12216.39698,Southampton,33485.69081
E02003572,Southampton 024,E02003572,Southampton 024,1367,5343.1,79,280,946,13,30078.454331,2484,8.13204508856683,15.4589371980676,75.2818035426731,2484,45.6119162640902,32.2463768115942,17.5523349436393,4.14653784219002,0.442834138486312,Southampton,2381,30332.48776,2597,9347.892573,Southampton,39680.380333
E02003573,Southampton 025,E02003573,Southampton 025,2106,6896.5,954,131,759,152,38992.167058,3236,43.5414091470952,6.11866501854141,47.8368355995056,3236,29.5735475896168,35.4140914709518,25.5871446229914,8.18912237330037,1.23609394313968,Southampton,2996,29240.86974,3470,12474.04171,Southampton,41714.91145
E02003574,Southampton 026,E02003574,Southampton 026,1972,6642.13,260,283,1194,23,37589.530008,3412,11.7819460726846,13.6576787807737,71.7174677608441,3412,40.767878077374,33.2942555685815,21.3364595545135,3.92731535756155,0.674091441969519,Southampton,3070,33475.75318,3599,12086.88364,Southampton,45562.63682
E02003575,Southampton 027,E02003575,Southampton 027,2028,6363.2,1075,150,684,51,36550.735401,2808,51.1396011396012,8.22649572649573,37.6424501424501,2808,29.5940170940171,34.4729344729345,26.0683760683761,8.72507122507123,1.13960113960114,Southampton,2028,17956.65328,2987,10984.80626,Southampton,28941.45954
E02003576,Southampton 028,E02003576,Southampton 028,2121,6990.9,478,502,1090,16,39556.606899,3434,22.8305183459522,18.5789167152009,56.4065230052417,3434,38.9924286546302,32.4403028538148,21.432731508445,6.37740244612697,0.75713453698311,Southampton,2999,30840.23115,3614,13260.24734,Southampton,44100.47849
E02003577,Southampton 029,E02003577,Southampton 029,5917,13132.5,968,1999,1317,452,77383.230565,4908,27.6079869600652,43.0929095354523,24.6740016299919,4908,37.917685411573,35.920945395273,18.6430317848411,6.0920945395273,1.42624286878566,Southampton,2420,20108.63369,6734,27352.6982,Southampton,47461.33189
E02003578,Southampton 030,E02003578,Southampton 030,1519,4876.4,173,291,933,21,27644.407294,2641,10.6399091253313,15.6758803483529,72.1317682695949,2641,44.0742143127603,33.2071185157137,18.5157137447936,3.5592578568724,0.643695569859902,Southampton,2493,26525.49559,2830,10046.80627,Southampton,36572.30186
E02003579,Southampton 031,E02003579,Southampton 031,3137,8201.7,220,622,1253,321,46309.490616,3357,11.5579386356866,23.8010128090557,63.0920464700626,3357,44.9210604706583,32.3205242776288,17.3369079535299,4.85552576705392,0.565981531128984,Southampton,3068,34052.12047,4460,13860.93609,Southampton,47913.05656
E02003580,Southampton 032,E02003580,Southampton 032,1804,5424.2,901,115,689,16,31120.7755975,2617,55.4833779136416,6.64883454337027,35.6897210546427,2617,27.2067252579289,35.2693924340848,25.4489873901414,10.8139090561712,1.26098586167367,Southampton,1716,15056.06366,2825,9432.095361,Southampton,24488.159021
This diff is collapsed.
# fridayFagPacket
# fridayFagPackets
A repo for our fridayFagPacket 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://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?](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/)
* 2017-01-20 - [A Most Unusual Sunday](https://energy.soton.ac.uk/a-most-unusual-sunday/)
\ No newline at end of file
* 2017-01-20 - [A Most Unusual Sunday](https://energy.soton.ac.uk/a-most-unusual-sunday/)
\ No newline at end of file
File deleted
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File deleted
This diff is collapsed.
This diff is collapsed.
---
title: "GDP & emissions - degrowthing or decoupling?"
author: "Ben Anderson & Tom Rushby"
date: "`r Sys.time()`"
format:
html:
self-contained: true
toc: true
code-fold: true
editor: visual
---
```{r}
#| label: setup
#| echo: false
#| warning: false
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=~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"))
```
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", "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
## 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-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(x = as.numeric(`GDP, PPP (constant 2017 international $)`)/1000000000,
y = as.numeric(`Annual CO2 emissions`)/1000000,
colour = Entity,
alpha = Year)) +
geom_point() +
labs(y = "Annual CO2 emissions (production-based, gT)",
x = "GDP $bn (constant 2017 $)",
caption = figCaption)
```
## Absolute consumption emissions
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-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(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(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 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. @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-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]
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() +
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)
```
## 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 down-tick.
```{r}
#| 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(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() +
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 efficiency: gC02e per \$ GDP?
Following <https://timjackson.org.uk/earth-vs-growth/> ...
```{r}
#| label: selectProduction
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 (production-based)`, colour = Entity)) +
geom_line() +
labs(y = "gC02 per $ GDP",
colour = "Country",
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?
Regardless of whether that aligns with [science-based targets](https://sciencebasedtargets.org/how-it-works) (i.e. absolute zero by 2044) ... what happens if the economy grows ... by say 2-3% per year? ... would that force total emissions up (fixed intensity) or result in efficiency gains (lower intensity)?
```{r}
#| label: selectCons
dt_abs[, `Emissions intensity (consumption-based)` := `Annual consumption-based CO2 emissions`/`GDP, PPP (constant 2017 international $)`*1000*1000]
```
```{r}
#| label: selectAndPlotConsumption
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",
caption = figCaption)
```
# Whom do we love?
[quarto](https://quarto.org/)
[data.table](https://www.rdocumentation.org/packages/data.table/versions/1.14.2)
[ggplot2](https://www.rdocumentation.org/packages/ggplot2/versions/3.3.6)
[here](https://www.rdocumentation.org/packages/here/versions/1.0.1)
[skimr](https://www.rdocumentation.org/packages/skimr/versions/2.1.4)
# Data descriptions
Check
Skim the absolute data:
```{r}
#| label: skimAbs
skimr::skim(dt_abs)
```
Skim the per capita data
```{r}
#| label: skimPC
skimr::skim(dt_pc)
```
```{r}
#| label: runToHere
# hidden chunk
```
# 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