── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.4.4 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.0
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Attaching package: 'scales'
The following object is masked from 'package:purrr':
discard
The following object is masked from 'package:readr':
col_factor
Energy Use and Global Warming
Rows: 21890 Columns: 129
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (2): country, iso_code
dbl (127): year, population, gdp, biofuel_cons_change_pct, biofuel_cons_chan...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
New names:
Rows: 135 Columns: 3
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (1): year
dbl (1): temp
lgl (1): ...3
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Introduction
For our project, we choose to focus on an a country energy use dataset from the organization Our World in Data which researches global problems. The dataset they provide is extensive, containing over 20,000 observations of 129 fields spanning approximately 120 years. It contains information on almost every country and region that has existed during this time frame (e.g. German Democratic Republic) and regional statistics. As more countries develop and increase their energy use, understanding how these dynamics work becomes ever more important especially considering the battle with climate change that directly relates to the use of fossil fuels as an energy source.
The fields we are looking at include fossil fuels (coal, natural gas, and oil) which have been shown to directly influence climate change; renewables including (solar, wind, geothermal, hydroelectric, etc.) which do not directly emit CO2 into the atmosphere leading to an increase in global surface temperatures; and Nuclear electric which is an expensive alternative to both fossil fuels and renewables, has an functionally limitless fuel source, but has the danger of melting down catastrophically in addition to the need to dispose of the spent radioative fuel at the end of the nuclear production process. Scientists debate on the best way to provide energy for the world and these debates, typically, include some mix of all these sources. Our analysis aims to look at the trends in energy production and its relation to climate change.
How does the energy mix vary by country for high, medium, and low wealth economies (measured by GDP)?
Introduction
With that as our impetus, we want to look at how energy use compares between the top and bottom global economies: what types of energy production do they use (i.e. coal, natural gas, oil, solar, nuclear). The richest countries consume the most energy because they have it available to them but what type of energy is that; the poorest countries are the most vulnerable to climate change and it is interesting to discover what types of energy they use.
To do this we use two groups of countries from the dataset: high-income
economies and lower middle-income economies
as defined by the World Bank, measured by gross national income (GNI) in 2022. We then look at how energy use statistics change over time from 1990 to 2021 for both groups, measuring consumption per capita in order to make better comparisons and to account for population changes over time. These energy dimensions include:
- Coal:
coal_cons_per_capita
- Natural gas:
gas_energy_per_capita
- Oil:
oil_energy_per_capita
- Renewable:
renewables_energy_per_capita
- Nuclear electric power:
nuclear_energy_per_capita
We were particularly interested in this question because we believe that understanding the differences in energy types and consumption between high-income and low-income countries is essential to see how we can transition towards greener energy sources.
Approach
To answer this question, we decided to produce two stacked bar plots with the year on as the x-axis, the per-capita energy consumption on the y-axis, and the fill defining the energy source. We feel this type of plot is best to illustrate the way different energy sources stack up by group of countries, as it makes trends over time clear, and lets us see absolute values while also letting us see the share a specific energy source provides.
Analysis
Warning: The `size` argument of `element_line()` is deprecated as of ggplot2 3.4.0.
ℹ Please use the `linewidth` argument instead.
Discussion
In the first plot we see the progression of energy use for high income economies since 1990. Taking all sources into account. Energy use peaked in the mid-2000s and has been gradually decreasing ever since. Fossil fuels specifically have decreased over this same time period as well. The use of renewable have slightly increased while the use of nuclear has slightly decreased since 1990. If we look at the metrics of coal, oil, and gas specifically the story changes: coal use has been decreasing, oil use increasing and gas consistent over the time period. Over all, energy use in the developed world has stayed relatively consistent since the 90s. While energy use has decreased and the replacement of coal with renewables has occurred, percapita energy use has not really changed alot over the past 30 years.
If we look at Lower and Middle income economies, the story is completely different. Energy use has increased every year (except 2020) since the mid-90s; coal and renewable use has almost doubled over that period. Overall, the use from all soruces has increased by ~50% over the time period. But it is necessary to note the scales of the y-axis. Low income countries use 1/10 of the energy the high income countries. The total energy use of a lower income country is almost as much as the year-to-year fluctuation in energy use of the higher income countries. Technology and the modern age is accelerating quickly and the implementations in lower income countries make a bigger difference in energy use than high income countries. Now that we have the context of which countries use what energy we can look at how energy use and global temperatures related.
Looking at the second set of graphs we can see the percent change in energy use by type and economy. We can see that high income countries have been decreasing their reliance on coal, nuclear, and oil energy sources but have increased their reliance on natural gas. We can also see the increase in renewable energy of over 80%. The graph for loer-middle income countries show that energy demand for all types (except nuclear has gone up considerably since the 90s. These graphs show us something that makes sense: countries that are poorer now were very poor in the 90s and their energy demand reflects that. As these societies begin to industrialize their energy demand will increase significantly.
Presentation
Our presentation can be found here.
Data
Our World in Data (June 6, 2023). Energy Data, https://github.com/rfordatascience/tidytuesday/blob/master/data/2023/2023-06-06/ (accessed 29 Feb 2024)
Compiled by Earth Policy Institute from National Aeronautics and Space Administration, Goddard Institute for Space Studies, “Global Land-Ocean Temperature Index in 0.01 Degrees Celsius,” at data.giss.nasa.gov/gistemp/tabledata_v3/GLB.Ts+dSST.txt, updated 15 January 2013. URL: http://www.earth-policy.org/indicators/c51/temperature_2013 (accessed 29 Feb 2024)
References
Compiled by Earth Policy Institute from National Aeronautics and Space Administration, Goddard Institute for Space Studies, “Global Land-Ocean Temperature Index in 0.01 Degrees Celsius,” at data.giss.nasa.gov/gistemp/tabledata_v3/GLB.Ts+dSST.txt, updated 15 January 2013. URL: http://www.earth-policy.org/indicators/c51/temperature_2013 (accessed 29 Feb 2024)