Improve IEA Ghana Industry Electricity data from 1974 through 2017
fix_GHA_industry_electricity.RdGhana's Industry Electricity data are specified for
Mining and quarrying,
Non-ferrous metals, and
Textiles and leather
for the year 1971--1973 only.
However, data are available from
the Ghana Grid Company (GridCo) and
the Volta River Authority
that fill most remaining years to 2017.
The details to fill the extra years are in the object Fixed_GHA_Industry_Electricity.
This function applies the fixes to years that are available in .tidy_iea_data.
Arguments
- .tidy_iea_df
a tidy IEA data frame produced by
load_tidy_iea_df()- country, year, e_dot
See
IEATools::iea_cols.
Details
See the Supplemental information to M. K. Heun and P. E. Brockway. Meeting 2030 primary energy and economic growth goals: Mission impossible? Applied Energy, 251(112697):1–24, May 2019 for additional details.
If .tidy_iea_df does not contain data from Ghana for the years in question,
no fixing is performed, and .tidy_iea_df is returned unmodified.
Also see the file named "GHA-IndustryElectricity.xlsx" for the actual calculations.
Examples
library(dplyr)
example_tidy_iea_df <- load_tidy_iea_df() %>%
filter(Country == "GHA")
example_tidy_iea_df
#> # A tibble: 122 × 11
#> Country Method Energy.type Last.stage Year Ledger.side Flow.aggregation.poi…
#> <chr> <chr> <chr> <chr> <dbl> <chr> <chr>
#> 1 GHA PCM E Final 1971 Supply Total primary energy…
#> 2 GHA PCM E Final 1971 Supply Total primary energy…
#> 3 GHA PCM E Final 1971 Supply Total primary energy…
#> 4 GHA PCM E Final 1971 Supply Total primary energy…
#> 5 GHA PCM E Final 1971 Supply Total primary energy…
#> 6 GHA PCM E Final 1971 Supply Total primary energy…
#> 7 GHA PCM E Final 1971 Supply Total primary energy…
#> 8 GHA PCM E Final 1971 Supply Total primary energy…
#> 9 GHA PCM E Final 1971 Supply Total primary energy…
#> 10 GHA PCM E Final 1971 Supply Total primary energy…
#> # … with 112 more rows, and 4 more variables: Flow <chr>, Product <chr>,
#> # Unit <chr>, E.dot <dbl>
fixed <- example_tidy_iea_df %>%
fix_GHA_industry_electricity()
# Compare changed values
example_tidy_iea_df %>%
filter(Flow %in% c("Mining and quarrying",
"Non-ferrous metals",
"Textile and leather",
"Industry not elsewhere specified"),
Product == "Electricity") %>%
select("Year", "Flow", "E.dot", "Unit")
#> # A tibble: 5 × 4
#> Year Flow E.dot Unit
#> <dbl> <chr> <dbl> <chr>
#> 1 1971 Mining and quarrying 16.7 ktoe
#> 2 1971 Non-ferrous metals 170. ktoe
#> 3 1971 Textile and leather 1.46 ktoe
#> 4 1971 Industry not elsewhere specified 21.9 ktoe
#> 5 2000 Industry not elsewhere specified 370. ktoe
fixed %>%
filter(Flow %in% c("Mining and quarrying",
"Non-ferrous metals",
"Textile and leather",
"Industry not elsewhere specified"),
Product == "Electricity") %>%
select("Year", "Flow", "E.dot", "Unit")
#> # A tibble: 8 × 4
#> Year Flow E.dot Unit
#> <dbl> <chr> <dbl> <chr>
#> 1 1971 Mining and quarrying 16.7 ktoe
#> 2 1971 Non-ferrous metals 170. ktoe
#> 3 1971 Textile and leather 1.46 ktoe
#> 4 1971 Industry not elsewhere specified 21.9 ktoe
#> 5 2000 Industry not elsewhere specified 104. ktoe
#> 6 2000 Mining and quarrying 45.4 ktoe
#> 7 2000 Non-ferrous metals 219. ktoe
#> 8 2000 Textile and leather 2.27 ktoe
# Show that new data are still in balance
example_tidy_iea_df %>%
filter(Year == 2000,
Product == "Electricity",
Flow == "Industry not elsewhere specified") %>%
select(E.dot) %>%
as.numeric()
#> [1] 370.2494
fixed %>%
filter(Year == 2000,
Product == "Electricity",
Flow %in% c("Mining and quarrying",
"Non-ferrous metals",
"Textile and leather",
"Industry not elsewhere specified")) %>%
select(E.dot) %>%
sum()
#> [1] 370.2494