Title: | Kaya Identity Data for Nations and Regions |
---|---|
Description: | Provides data for Kaya identity variables (population, gross domestic product, primary energy consumption, and energy-related CO2 emissions) for the world and for individual nations, and utility functions for looking up data, plotting trends of Kaya variables, and plotting the fuel mix for a given country or region. The Kaya identity (Yoichi Kaya and Keiichi Yokobori, "Environment, Energy, and Economy: Strategies for Sustainability" (United Nations University Press, 1998) and <https://en.wikipedia.org/wiki/Kaya_identity>) expresses a nation's or region's greenhouse gas emissions in terms of its population, per-capita Gross Domestic Product, the energy intensity of its economy, and the carbon-intensity of its energy supply. |
Authors: | Jonathan Gilligan [cre, aut] |
Maintainer: | Jonathan Gilligan <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.4.0 |
Built: | 2024-11-09 04:53:31 UTC |
Source: | https://github.com/jonathan-g/kayadata |
kayadata is a package for working with Kaya identity data for many countries and regions.
The Kaya identity, named for the economist Yoichi Kaya, who introduced it (Kaya, 1998); It decomposes the energy-related carbon dioxide emissions from a nation, region, or the world into the product of four components:
where F is the total emissions, P is the population, g is the per-capita GDP, e is the energy intensity of the economy, and f is the emissions-intensity of the energy supply. (Nakicenovic and Swart, 2000, Ch. 3, p. 105; Raupach et al, 2007)
The data in this packages covers 1960-2019 for population and GDP, and 1965-2019 for energy and fossil-fuel CO2 emissions.
The package uses data on population and GDP from the World Bank,
using market exchange rates (MER) for GDP because those data go back to
1960. From 1990 onward, Purchasing-Power-Parity (PPP) GDP figures are
available as G_ppp
but using these would require re-calculating
G
, g
, e
, and ef
in the kaya_data
data frame.
The package uses data on energy consumption and fossil-fuel CO2 emissions from the Energy Institute's 2024 Statistical Review of World Energy
The kayadata package is open source licensed under the MIT License.
kayadata issue tracker (https://github.com/jonathan-g/kayadata/issues)
Maintainer: Jonathan Gilligan [email protected] (ORCID)
Kaya, Yoichi and Keiichi Yokobori, Environment, Energy, and Economy: Strategies for Sustainability (United Nations University Press, 1998).
Nakicenovic, Nebojsa, and Rob Swart (Eds.), Special Report on Emissions Scenarios (Cambridge University Press, 2000). https://www.ipcc.ch/report/emissions-scenarios/
Raupach, Michael R., et al., "Global and regional drivers of accelerating CO2 emissions," PNAS 104, 10288–10293 (2007) doi:10.1073/pnas.0700609104.
Useful links:
Report bugs at https://github.com/jonathan-g/kayadata/issues
Get emission factors for different energy sources
emissions_factors(collapse_renewables = TRUE)
emissions_factors(collapse_renewables = TRUE)
collapse_renewables |
Combine hydroelectricity and other renewables into a single category. |
a tibble of values for emissions factors, in million metric tons of carbon dioxide per quad of energy.
e_fac <- emissions_factors() e_fac
e_fac <- emissions_factors() e_fac
A dataset containing the fuel mix of how many quads and what fraction of total primary energy supply comes from coal, gas, oil, nuclear, and renewable sources.
fuel_mix
fuel_mix
A tibble containing 948 rows and 7 variables
Country or region name
Three-letter country or region code
Geographic category: "nation", "region", or "world"
The year
The fuel: "Coal", "Natural Gas", "Oil", "Nuclear", "Hydro", and "Renewables"
The number of quads of that fuel consumed in the given country or region and year
The fraction of that country or region's total primary energy consumption from the fuel
The data for 2022, from the 2023 release of the Energy Institute's Statistical Review, has inconsistencies in the fuel mix for Hong Kong and Sri Lanka: The percentages add up to 98.7% and 102.9%, respectively. The sums of energy in quads are off by -0.095 and +0.095 quads, respectively, from the total energy figure.
https://www.energyinst.org/statistical-review/resources-and-data-downloads
Nameplate capacity and capacity factors for different electrical generation technologies. The average power supplied over a year is the nameplate capacity times the capacity factor.
generation_capacity()
generation_capacity()
Data for fossil fuels comes from EIA
a tibble of values for generation sources
Energy source: Coal, Nuclear, Gas, Solar Thermal, Solar Photovoltaic, Onshore Wind, or Offshore Wind
Text description of the power source
Maximum sustained power output, in megawatts
Capacity factor: the fraction of the nameplate capacity that the plant can provide, averaged over a typical year
Environmental Protection Agency (2018) "Electric Power Monthly," (October, 2018) https://www.eia.gov/electricity/monthly/archive/october2018.pdf, Table 6.7.A.
Pielke, Jr., Roger A., The Climate Fix (Basic Books, 2010).
gc <- generation_capacity() gc
gc <- generation_capacity() gc
Get fuel mix for one or more countries or regions
get_fuel_mix( region_name, collapse_renewables = TRUE, quiet = FALSE, region_code = NULL )
get_fuel_mix( region_name, collapse_renewables = TRUE, quiet = FALSE, region_code = NULL )
region_name |
A character vector with the names of one or more countries or regions to look up |
collapse_renewables |
Combine hydroelectricity and other renewables into a single category. |
quiet |
Suppress warnings if there is no data for that country or region. |
region_code |
Optional three-letter country or region codes to look up
instead of the |
A tibble of fuel mix for the countries or regions specified. That is, the number of quads of each fuel and the fraction of total primary energy coming from that fuel for each country or region:
The name of the country or region
The year reported
The name of the fuel
The number of quads per year the country or region consumes
The fraction of the country's energy that comes from that fuel
In the latest data from the Energy Institute, there are small
discrepancies between the sums of energy for each fuel and the totals,
in both quads
and frac
, for Hong Kong and Sri Lanka, as described
in the documentation for fuel_mix.
get_fuel_mix("United States") get_fuel_mix("World", collapse_renewables = FALSE) get_fuel_mix(region_code = "LCN")
get_fuel_mix("United States") get_fuel_mix("World", collapse_renewables = FALSE) get_fuel_mix(region_code = "LCN")
Get Kaya data for one or more countries or regions
get_kaya_data( region_name, gdp = c("MER", "PPP"), quiet = FALSE, region_code = NULL )
get_kaya_data( region_name, gdp = c("MER", "PPP"), quiet = FALSE, region_code = NULL )
region_name |
The name of one or more countries or regions to look up |
gdp |
Use market exchange rates ( |
quiet |
Suppress warnings if there is no such country or region. |
region_code |
Optional three-letter country or region codes to look up
instead of the |
Units for G, g, e, and ef depend on whether the data is requested in MER or PPP dollars: For MER, dollars are constant 2015 U.S. dollars. For PPP, dollars are constant 2017 international dollars.
_P_ and MER values for GDP and related quantities are available from 1960 onward. PPP values for GDP and related quantities are only available from 1990 onward. Energy-related values (_E_, _F_, and derived quantities) are available from 1965 onward. Note that emissions (_F_, _f_, and _ef_) are reported as millions of metric tons of carbon dioxide, not carbon.
a tibble of Kaya identity data for the countries or regions specified:
The name of the country or region
The year
Population, in billions
Gross domestic product, in trillions of constant 2015 U.S. dollars.
Total primary energy consumption, in quads
CO2 emissions from fossil fuel consumption, in millions of metric tons
Per-capita GDP, in thousands of dollars per person.
Energy intensity of the economy, in quads per trillion dollars.
Emissions intensity of the energy supply, in million metric tons per quad.
Emissions intensity of the economy, in metric tons per million dollars of GDP.
get_kaya_data("Brazil") get_kaya_data("United Kingdom", "PPP") get_kaya_data(region_name = "United States") get_kaya_data(region_code = "MYS")
get_kaya_data("Brazil") get_kaya_data("United Kingdom", "PPP") get_kaya_data(region_name = "United States") get_kaya_data(region_code = "MYS")
Get top-down trends for Kaya variables for one or more countries or regions, using projections from U.S. Energy Information Administration's International Energy Outlook report.
get_top_down_trends(region_name, quiet = FALSE, region_code = NULL)
get_top_down_trends(region_name, quiet = FALSE, region_code = NULL)
region_name |
The name of one or more countries or regions to look up |
quiet |
Suppress warnings if there is no data for the specified countries or regions. |
region_code |
Optional three-letter country or region codes to look up
instead of the |
a tibble of trends for P, G, E, F, g, e, f, and ef for each country or region in percent per year.
get_top_down_trends("Spain") get_top_down_trends(region_code = "RUS")
get_top_down_trends("Spain") get_top_down_trends(region_code = "RUS")
Get top-down projections of Kaya variables for one or more countries or regions
get_top_down_values(region_name, quiet = FALSE, region_code = NULL)
get_top_down_values(region_name, quiet = FALSE, region_code = NULL)
region_name |
The name of a country or region to look up |
quiet |
Suppress warnings if there is no data for that country or region. |
region_code |
Optional three-letter country or region code to look up
instead of the |
a tibble of values for P, G, E, F, g, e, f, and ef for each country or region:
The name of the country or region
Population, in billions
Gross domestic product, in trillions of constant 2015 U.S. dollars.
Total primary energy consumption, in quads
CO2 emissions from fossil fuel consumption, in millions of metric tons
Per-capita GDP, in thousands of constant 2015 U.S. dollars per person.
Energy intensity of the economy, in quads per trillion dollars.
Emissions intensity of the energy supply, in million metric tons per quad.
Emissions intensity of the economy, in metric tons per million dollars of GDP.
get_top_down_values("New Zealand") get_top_down_values("OECD") get_top_down_values(region_code = "PAK")
get_top_down_values("New Zealand") get_top_down_values("OECD") get_top_down_values(region_code = "PAK")
A dataset containing Kaya identity parameters P, G, E, F, g, e, f, and ef for many countries
kaya_data
kaya_data
A tibble containing 5292 rows and 14 variables:
Country or region name
Three-letter country or region code
Geographic category: "nation", "region", or "world"
The year
Population, in billions
Gross domestic product, in trillions of constant 2015 U.S. dollars.
Total primary energy consumption, in quads
CO2 emissions from fossil fuel consumption, in millions of tons
Per-capita GDP, in thousands of constant 2015 U.S. dollars per person.
Energy intensity of the economy, in quads per trillion dollars.
Emissions intensity of the energy supply, in million metric tons per quad.
Emissions intensity of the economy, in metric tons per million dollars of GDP.
Gross domestic product adjusted for purchasing power parity, in trillions of constant 2017 international dollars
Gross domestic product at market-exchange-rate, in trillions of constant 2015 U.S. dollars
https://data.worldbank.org/indicator/SP.POP.TOTL, https://data.worldbank.org/indicator/NY.GDP.MKTP.KD, and https://www.energyinst.org/statistical-review/resources-and-data-downloads
Get a list of countries in the Kaya data
kaya_region_list()
kaya_region_list()
a vector of country and region names
The number of megawatts of average power output over a year to produce one quad of energy
megawatts_per_quad()
megawatts_per_quad()
The number of megawatts equivalent to one quad per year.
mwe <- megawatts_per_quad() mwe
mwe <- megawatts_per_quad() mwe
Plot fuel mix
plot_fuel_mix( fuel_mix, collapse_renewables = TRUE, title = NULL, colors = NULL, font_size = 20 )
plot_fuel_mix( fuel_mix, collapse_renewables = TRUE, title = NULL, colors = NULL, font_size = 20 )
fuel_mix |
A tibble with the mixture of fuels for one or more countries or regions:
|
collapse_renewables |
Combine hydroelectricity and other renewables into a single category. |
title |
Include a title on the plot. If |
colors |
A named vector with the colors to use for
|
font_size |
The base font size. |
A plot object.
usa_fuel <- get_fuel_mix("United States", collapse_renewables = FALSE) plot_fuel_mix(usa_fuel) plot_fuel_mix(usa_fuel, collapse_renewables = FALSE) plot_fuel_mix(usa_fuel, collapse_renewables = FALSE, colors = c(Coal = "black", "Natural Gas" = "gray60", Oil = "gray30", Nuclear = "forestgreen", Hydro = "royalblue", Renewables="palegreen")) plot_fuel_mix("United States") plot_fuel_mix("USA")
usa_fuel <- get_fuel_mix("United States", collapse_renewables = FALSE) plot_fuel_mix(usa_fuel) plot_fuel_mix(usa_fuel, collapse_renewables = FALSE) plot_fuel_mix(usa_fuel, collapse_renewables = FALSE, colors = c(Coal = "black", "Natural Gas" = "gray60", Oil = "gray30", Nuclear = "forestgreen", Hydro = "royalblue", Renewables="palegreen")) plot_fuel_mix("United States") plot_fuel_mix("USA")
Plot Kaya-identity variable
plot_kaya( data, variable, start_year = NA, stop_year = NA, y_lab = NULL, log_scale = FALSE, trend_line = FALSE, points = TRUE, font_size = 20, colors = NULL, pre_color = NULL, post_color = NULL, in_range_color = NULL, trend_color = NULL, line_sizes = NULL, pre_line_size = NULL, post_line_size = NULL, in_range_line_size = NULL, trend_line_size = NULL, point_sizes = NULL, pre_point_size = NULL, post_point_size = NULL, in_range_point_size = NULL )
plot_kaya( data, variable, start_year = NA, stop_year = NA, y_lab = NULL, log_scale = FALSE, trend_line = FALSE, points = TRUE, font_size = 20, colors = NULL, pre_color = NULL, post_color = NULL, in_range_color = NULL, trend_color = NULL, line_sizes = NULL, pre_line_size = NULL, post_line_size = NULL, in_range_line_size = NULL, trend_line_size = NULL, point_sizes = NULL, pre_point_size = NULL, post_point_size = NULL, in_range_point_size = NULL )
data |
A tibble with Kaya-identity data or the name of a region or a region code. |
variable |
The name of the variable to plot (character) |
start_year |
The year to start highlighting the data (should correspond
to the beginning of the trend calculation). Set to |
stop_year |
The year to stop highlighting the data (should correspond
to the beginning of the trend calculation). Set to |
y_lab |
Optional label for the y-axis |
log_scale |
Use log scale for y axis |
trend_line |
Include a trend line |
points |
Plot points in addition to the line. |
font_size |
Base size of the font for axis labels and titles. |
colors |
Named vector of colors to use for the plot. Elements should
include
|
pre_color |
Override default color for the portion of the chart before
|
post_color |
Override default color for the portion of the chart after
|
in_range_color |
Override default color for the portion of the chart
between |
trend_color |
Override default color for the trend line. |
line_sizes |
Named vector of sizes to use for the lines in the plot.
Elements should include
|
pre_line_size |
Override default line size for the portion of the chart
before |
post_line_size |
Override default line size for the portion of the
chart after |
in_range_line_size |
Override default line size for the portion of the
chart between |
trend_line_size |
Override default size for the trend line. |
point_sizes |
Named vector of sizes to use for the points in the plot.
Elements should include
|
pre_point_size |
Override default point size for the portion of the
chart before |
post_point_size |
Override default point size for the portion of the
chart after |
in_range_point_size |
Override default point size for the portion of the
chart between |
A plot object.
china <- get_kaya_data("China") plot_kaya(china, "F", 2001, 2011) ## Not run: uk <- get_kaya_data("United Kingdom") plot_kaya(uk, "e", log_scale = TRUE, trend_line = TRUE) plot_kaya(uk, "e", log_scale = TRUE, trend_line = TRUE, start_year = 1970, stop_year = 2000, colors = c(PRE="limegreen", POST="darkgreen", "IN-RANGE" = "cadetblue", TREND="orange"), line_sizes = c(PRE=0.5, POST=0.5, "IN-RANGE"=1, TREND=1.5), point_sizes = c(PRE=2, POST=2, "IN-RANGE"=3)) plot_kaya(uk, "e", log_scale = TRUE, trend_line = TRUE, start_year = 1970, stop_year = 2000, pre_color = "limegreen", post_color = "limegreen", trend_color = "magenta", pre_line_size = 0.5, post_line_size = 0.5, trend_line_size = 1.5, pre_point_size = 2, post_point_size = 2, in_range_point_size = 3) plot_kaya("United Kingdom") plot_kaya("GBR") ## End(Not run) world <- get_kaya_data("World") plot_kaya(world, "g", 1982, log_scale = TRUE, trend_line = TRUE)
china <- get_kaya_data("China") plot_kaya(china, "F", 2001, 2011) ## Not run: uk <- get_kaya_data("United Kingdom") plot_kaya(uk, "e", log_scale = TRUE, trend_line = TRUE) plot_kaya(uk, "e", log_scale = TRUE, trend_line = TRUE, start_year = 1970, stop_year = 2000, colors = c(PRE="limegreen", POST="darkgreen", "IN-RANGE" = "cadetblue", TREND="orange"), line_sizes = c(PRE=0.5, POST=0.5, "IN-RANGE"=1, TREND=1.5), point_sizes = c(PRE=2, POST=2, "IN-RANGE"=3)) plot_kaya(uk, "e", log_scale = TRUE, trend_line = TRUE, start_year = 1970, stop_year = 2000, pre_color = "limegreen", post_color = "limegreen", trend_color = "magenta", pre_line_size = 0.5, post_line_size = 0.5, trend_line_size = 1.5, pre_point_size = 2, post_point_size = 2, in_range_point_size = 3) plot_kaya("United Kingdom") plot_kaya("GBR") ## End(Not run) world <- get_kaya_data("World") plot_kaya(world, "g", 1982, log_scale = TRUE, trend_line = TRUE)
Get top-down projections of Kaya variables for one or more countries or regions for a given year
project_top_down(region_name, year, quiet = FALSE, region_code = NULL)
project_top_down(region_name, year, quiet = FALSE, region_code = NULL)
region_name |
The name of a country or region to look up |
year |
The year to project to |
quiet |
Suppress warnings if there is no data for that country or region. |
region_code |
Optional three-letter country or region code to look up
instead of the |
a tibble of values for P, G, E, F, g, e, f, and ef for each country or region:
The name of the country or region
The year
Population, in billions
Gross domestic product, in trillions of constant 2015 U.S. dollars.
Total primary energy consumption, in quads
CO2 emissions from fossil fuel consumption, in millions of metric tons
Per-capita GDP, in thousands of constant 2015 U.S. dollars per person.
Energy intensity of the economy, in quads per trillion dollars.
Emissions intensity of the energy supply, in million metric tons per quad.
Emissions intensity of the economy, in metric tons per million dollars of GDP.
project_top_down("China", 2037) project_top_down(region_code = "CHE", year = 2043)
project_top_down("China", 2037) project_top_down(region_code = "CHE", year = 2043)
Problems with aggregate regional data
The World Bank is missing GDP data for a number of nations, such as Syria
and Taiwan. Because of this and the incommensurability between the regions
used for aggregate statistics in the World Bank and Energy Institute data,
aggregate regional data (e.g., for the Middle East and Africa) should be
treated with caution.
This problem does not hold for individual nations, where missing data
appears as NA
values.
A dataset containing top-down projections of trends in P, G, and E, from the EIA's International Energy Outlook 2017.
td_trends
td_trends
A tibble containing 226 rows and 11 variables
Country or region name
Three-letter country or region code
Geographic category: "nation", "region", or "world"
Trend in population, in fraction per year
Trend in gross domestic product, in fraction per year
Trend in total primary energy consumption, in fraction per year
Trend in CO2 emissions, in fraction per year
Trend in per-capita GDP, in fraction per year
Trend in energy intensity of the economy, in fraction per year
Trend in emissions intensity of the energy supply, in fraction per year
Trend in emissions intensity of the economy, in fraction per year
https://www.eia.gov/outlooks/archive/ieo17/
regions, get_top_down_trends()
A dataset containing top-down projections of P, G, and E, from the EIA's International Energy Outlook 2017.
td_values
td_values
A tibble containing 640 rows and 12 variables
Country or region name
Three-letter country or region code
Geographic category: "nation", "region", or "world"
The year
Population, in billions
Gross domestic product, in trillions of constant 2015 U.S. dollars
Total primary energy consumption, in quads
Total CO2 emissions, in millions of metric tons
Per-capita GDP, in thousands of constant 2015 U.S. dollars per person.
Energy intensity of the economy, in quads per trillion dollars.
Emissions intensity of the energy supply, in million metric tons per quad.
Emissions intensity of the economy, in metric tons per million dollars of GDP.
https://www.eia.gov/outlooks/archive/ieo17/
regions, get_top_down_values()