fix_COL_WRLD_electricity: Improve COL electricity generation in the IEA's WEEB.

View source: R/fixes.R

fix_COL_WRLD_electricityR Documentation

Improve COL electricity generation in the IEA's WEEB.

Description

The 2022 release of the IEA's WEEB data is different from the 2021 release of the IEA's WEEB data in terms of Colombia's Electricity generation. For example:

  • 2021 release:

    • Main activity producer electricity plants 34196.4008 TJ

    • Autoproducer electricity plants: 2671.1993 TJ

  • 2022 release:

    • Main activity producer electricity plants 31467.5994 TJ

    • Autoproducer electricity plants: 899.9987 TJ Similar differences appear in all years 1971 - 1977. From 1978 onward, the 2021 and 2022 releases agree. Note that this change leads to overall energy imbalance for Colombia 1971-1977 and World 1971-1977. This function reverts to the values from the 2021 release of the IEA WEEB.

Usage

fix_COL_WRLD_electricity(
  .tidy_iea_df,
  country = IEATools::iea_cols$country,
  year = IEATools::iea_cols$year,
  e_dot = IEATools::iea_cols$e_dot
)

Arguments

.tidy_iea_df

A tidy IEA data frame produced by load_tidy_iea_df().

country, year, e_dot

See IEATools::iea_cols.

Details

Similarly, World Electricity is different 2021 release to 2022 release. The 2022 data are unbalanced for 1971 –> 1977. This function reverts to the value from the 2021 release of the IEA WEEB for World Electricity in 1971–1977.

Value

.tidy_iea_df with improved Ghana Industry Electricity, if warranted.

Examples

library(dplyr)
example_tidy_iea_df <- load_tidy_iea_df() %>% 
  dplyr::filter(Country == "GHA") |> 
  dplyr::mutate(
    # Pretend that GHA is COL.
    Country = "COL"
  )
example_tidy_iea_df
fixed <- example_tidy_iea_df %>% 
  fix_COL_WRLD_electricity()
# Compare changed values
example_tidy_iea_df %>% 
  dplyr::filter(Flow %in% c("Main activity producer electricity plants",
                            "Autoproducer electricity plants"), 
         Product == "Electricity") %>% 
  dplyr::select("Year", "Flow", "E.dot", "Unit")
fixed %>% 
  dplyr::filter(Flow %in% c("Main activity producer electricity plants",
                      "Autoproducer electricity plants"), 
                Product == "Electricity") %>% 
  dplyr::select("Year", "Flow", "E.dot", "Unit")

MatthewHeun/IEATools documentation built on Feb. 6, 2024, 3:29 p.m.