specify_losses_as_industry.Rd
Losses are originally treated as a final demand flow in the IEA WEEB balances. This function allows analysts to redefine losses as a transformation industry, which takes as input "Product (before Losses)" and provides "Product". Hence, final demand sectors still consume "Product", but where relevant, products go first through a "Losses (of Product)" industry.
specify_losses_as_industry(
.tidy_iea_df,
country = IEATools::iea_cols$country,
method = IEATools::iea_cols$method,
energy_type = IEATools::iea_cols$energy_type,
last_stage = IEATools::iea_cols$last_stage,
year = IEATools::iea_cols$year,
ledger_side = IEATools::iea_cols$ledger_side,
flow_aggregation_point = IEATools::iea_cols$flow_aggregation_point,
flow = IEATools::iea_cols$flow,
product = IEATools::iea_cols$product,
unit = IEATools::iea_cols$unit,
e_dot = IEATools::iea_cols$e_dot,
matnames = IEATools::mat_meta_cols$matnames,
losses = IEATools::tfc_compare_flows$losses,
imports = IEATools::interface_industries$imports,
stat_diffs = IEATools::tfc_compare_flows$statistical_differences,
transformation_processes = IEATools::tfc_compare_flows$transformation_processes,
supply = IEATools::ledger_sides$supply,
observation_string = "Observation_String"
)
The .tidy__iea_df
for which losses need to be specified as transformation industry.
See IEATools::iea_cols
.
The name of the matrix name column in the input data frame.
The name of the "Losses" flows in the input data frame.
Default is IEATools::tfc_compare_flows$losses
.
The name of "Imports" flows in the input data frame.
Default is IEATools::interface_industries$imports
.
The name of "Statistical differences" flows in the input data frame.
Default is IEATools::tfc_compare_flows$statistical_differences
.
The name of transformation processes in the flow aggregation point column.
Default is IEATools::tfc_compare_flows$transformation_processes
.
The name of the supply ledger side.
Default is IEATools::ledger_sides$supply
.
The name of a temporary column identifying the observation. Default is "Observation_String".
A .tidy_iea_df
with losses specified as a transformation industry.
TO DO:!!! Importantly, we need to check that values do not become negative...!!!
ECCTools::tidy_AB_data %>%
tibble::add_row(
Country = "A",
Method = "PCM",
Energy.type = "E",
Last.stage = "Final",
Year = 2018,
Ledger.side = "Supply",
Flow.aggregation.point = "TFC compare",
Flow = "Losses",
Product = "Coke oven coke",
Unit = "ktoe",
E.dot = -20
) %>%
IEATools::add_psut_matnames() %>%
specify_losses_as_industry()
#> # A tibble: 104 × 12
#> Country Method Energy.type Last.stage Year Ledger.side
#> <chr> <chr> <chr> <chr> <dbl> <chr>
#> 1 A PCM E Final 2018 Consumption
#> 2 A PCM E Final 2018 Consumption
#> 3 A PCM E Final 2018 Consumption
#> 4 A PCM E Final 2018 Consumption
#> 5 A PCM E Final 2018 Consumption
#> 6 A PCM E Final 2018 Consumption
#> 7 A PCM E Final 2018 Consumption
#> 8 A PCM E Final 2018 Consumption
#> 9 A PCM E Final 2018 Consumption
#> 10 A PCM E Final 2018 Consumption
#> # ℹ 94 more rows
#> # ℹ 6 more variables: Flow.aggregation.point <chr>, Flow <chr>, Product <chr>,
#> # Unit <chr>, E.dot <dbl>, matnames <chr>