Fix IEA data for Other non-OECD Americas Gas works plants
fix_OAMR_gw.Rd
Other Non-OECD Americas has several years (1971–1976)
in which Gas works gas is produced
but no feedstocks are consumed to
create the Gas works gas.
This function corrects that problem.
In particular, after calling this function,
Gas works
will consume Natural gas in all years, and
Natural gas production is boosted accordingly.
The efficiency of World Gas works plants plants in 1971-1976
was used to create the filled data.
This function uses data in the IEATools::Fixed_OAMR_gw
data frame.
Arguments
- .tidy_iea_df
A tidy IEA data frame produced by
load_tidy_iea_df()
.- country, year, e_dot
See
IEATools::iea_cols
.
Examples
library(dplyr)
example_tidy_iea_df <- load_tidy_iea_df() |>
dplyr::filter(Country == "ZAF", Year == 1971) |>
dplyr::mutate(
# Pretend that ZAF is Other non-OECD Americas.
Country = "OAMR"
)
example_tidy_iea_df
#> # A tibble: 98 × 11
#> Country Method EnergyType LastStage Year LedgerSide FlowAggregationPoint
#> <chr> <chr> <chr> <chr> <dbl> <chr> <chr>
#> 1 OAMR PCM E Final 1971 Supply Total primary energy su…
#> 2 OAMR PCM E Final 1971 Supply Total primary energy su…
#> 3 OAMR PCM E Final 1971 Supply Total primary energy su…
#> 4 OAMR PCM E Final 1971 Supply Total primary energy su…
#> 5 OAMR PCM E Final 1971 Supply Total primary energy su…
#> 6 OAMR PCM E Final 1971 Supply Total primary energy su…
#> 7 OAMR PCM E Final 1971 Supply Total primary energy su…
#> 8 OAMR PCM E Final 1971 Supply Total primary energy su…
#> 9 OAMR PCM E Final 1971 Supply Total primary energy su…
#> 10 OAMR PCM E Final 1971 Supply Total primary energy su…
#> # ℹ 88 more rows
#> # ℹ 4 more variables: Flow <chr>, Product <chr>, Unit <chr>, Edot <dbl>
fixed <- example_tidy_iea_df |>
fix_OAMR_gw()
# Compare changed values
example_tidy_iea_df |>
dplyr::filter(Flow %in% c("Production",
"Gas works"),
Product %in% c("Gas works gas", "Natural gas")) |>
dplyr::select("Year", "Flow", "Product", "Edot", "Unit")
#> # A tibble: 1 × 5
#> Year Flow Product Edot Unit
#> <dbl> <chr> <chr> <dbl> <chr>
#> 1 1971 Gas works Gas works gas 5797. TJ
fixed %>%
dplyr::filter(Flow %in% c("Production",
"Gas works"),
Product %in% c("Gas works gas", "Natural gas")) |>
dplyr::select("Year", "Flow", "Product", "Edot", "Unit")
#> # A tibble: 3 × 5
#> Year Flow Product Edot Unit
#> <dbl> <chr> <chr> <dbl> <chr>
#> 1 1971 Gas works Gas works gas 82.8 TJ
#> 2 1971 Production Natural gas 210. TJ
#> 3 1971 Gas works Natural gas -105. TJ