Improve COL electricity generation in the IEA's WEEB.
fix_COL_WRLD_electricity.Rd
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.
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.
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
#> # A tibble: 122 × 11
#> Country Method EnergyType LastStage Year LedgerSide FlowAggregationPoint
#> <chr> <chr> <chr> <chr> <dbl> <chr> <chr>
#> 1 COL PCM E Final 1971 Supply Total primary energy su…
#> 2 COL PCM E Final 2000 Supply Total primary energy su…
#> 3 COL PCM E Final 1971 Supply Total primary energy su…
#> 4 COL PCM E Final 2000 Supply Total primary energy su…
#> 5 COL PCM E Final 1971 Supply Total primary energy su…
#> 6 COL PCM E Final 2000 Supply Total primary energy su…
#> 7 COL PCM E Final 2000 Supply Total primary energy su…
#> 8 COL PCM E Final 2000 Supply Total primary energy su…
#> 9 COL PCM E Final 1971 Supply Total primary energy su…
#> 10 COL PCM E Final 2000 Supply Total primary energy su…
#> # ℹ 112 more rows
#> # ℹ 4 more variables: Flow <chr>, Product <chr>, Unit <chr>, Edot <dbl>
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", "Edot", "Unit")
#> # A tibble: 2 × 4
#> Year Flow Edot Unit
#> <dbl> <chr> <dbl> <chr>
#> 1 1971 Main activity producer electricity plants 10598. TJ
#> 2 2000 Main activity producer electricity plants 26003. TJ
fixed %>%
dplyr::filter(Flow %in% c("Main activity producer electricity plants",
"Autoproducer electricity plants"),
Product == "Electricity") %>%
dplyr::select("Year", "Flow", "Edot", "Unit")
#> # A tibble: 3 × 4
#> Year Flow Edot Unit
#> <dbl> <chr> <dbl> <chr>
#> 1 1971 Main activity producer electricity plants 34196. TJ
#> 2 2000 Main activity producer electricity plants 26003. TJ
#> 3 1971 Autoproducer electricity plants 2671. TJ