Improve Ghana Primary solid biofuels data from 1991 through 1999
fix_GHA_psb.Rd
Ghana's Primary solid biofuels data show a very large and dramatic decline from 1999 to 2000. This decline is due to new survey data being used for the 2000 data. When we look at the PSB data on a per-capita basis, it is clear that a near-constant PSB/capita value was used to extrapolate per-capita usage in the late 1990s. When new survey data became available for the 2000 reporting year, the per-capita consumption of PSB obviously changed. Our approach to this problem is to smooth out the really big peak in PSB consumption by reducing the per-capita consumption of PSB, starting in 1991.
Arguments
- .tidy_iea_df
a tidy IEA data frame produced by
load_tidy_iea_df()
- country, year, e_dot
See
IEATools::iea_cols
.
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.
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.
Also see the file named "GHA-PSB.xlsx" for the actual calculations.
Examples
library(dplyr)
# Build an example tidy IEA data frame in which Ghana's Primary solid biofuels can be fixed.
example_tidy_iea_df <- load_tidy_iea_df() %>%
filter(Country == "GHA") %>%
filter(Product == "Primary solid biofuels") %>%
# The example data frame has PSB for Ghana for 1971 and 2000.
# Let's pretend that 1971 is 1991 and 2000 is 1992.
mutate(
Year := dplyr::case_when(
Year == 1971 ~ 1991,
Year == 2000 ~ 1992
)
)
example_tidy_iea_df
#> # A tibble: 10 × 11
#> Country Method EnergyType LastStage Year LedgerSide FlowAggregationPoint
#> <chr> <chr> <chr> <chr> <dbl> <chr> <chr>
#> 1 GHA PCM E Final 1991 Supply Total primary energy s…
#> 2 GHA PCM E Final 1992 Supply Total primary energy s…
#> 3 GHA PCM E Final 1991 Supply Transformation process…
#> 4 GHA PCM E Final 1992 Supply Transformation process…
#> 5 GHA PCM E Final 1991 Consumption Industry
#> 6 GHA PCM E Final 1992 Consumption Industry
#> 7 GHA PCM E Final 1991 Consumption Other
#> 8 GHA PCM E Final 1992 Consumption Other
#> 9 GHA PCM E Final 1992 Consumption Other
#> 10 GHA PCM E Final 1992 Consumption Other
#> # ℹ 4 more variables: Flow <chr>, Product <chr>, Unit <chr>, Edot <dbl>
fixed <- example_tidy_iea_df %>%
fix_GHA_psb()
# Compare production of Primary solid biofuels in 1991
example_tidy_iea_df %>%
filter(Year == 1991, Flow == "Production") %>%
select("Edot", "Unit")
#> # A tibble: 1 × 2
#> Edot Unit
#> <dbl> <chr>
#> 1 87400. TJ
fixed %>%
filter(Year == 1991, Flow == "Production") %>%
select("Edot", "Unit")
#> # A tibble: 1 × 2
#> Edot Unit
#> <dbl> <chr>
#> 1 168519. TJ