specify_losses_as_industry: Specifies losses as a transformation industry

View source: R/losses.R

specify_losses_as_industryR Documentation

Specifies losses as a transformation industry

Description

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.

Usage

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"
)

Arguments

.tidy_iea_df

The .tidy__iea_df for which losses need to be specified as transformation industry.

country, method, energy_type, last_stage, ledger_side, flow_aggregation_point, year, flow, product, unit, e_dot

See IEATools::iea_cols.

matnames

The name of the matrix name column in the input data frame.

losses

The name of the "Losses" flows in the input data frame. Default is IEATools::tfc_compare_flows$losses.

imports

The name of "Imports" flows in the input data frame. Default is IEATools::interface_industries$imports.

stat_diffs

The name of "Statistical differences" flows in the input data frame. Default is IEATools::tfc_compare_flows$statistical_differences.

transformation_processes

The name of transformation processes in the flow aggregation point column. Default is IEATools::tfc_compare_flows$transformation_processes.

supply

The name of the supply ledger side. Default is IEATools::ledger_sides$supply.

observation_string

The name of a temporary column identifying the observation. Default is "Observation_String".

Details

TO DO:!!! Importantly, we need to check that values do not become negative...!!!

Value

A .tidy_iea_df with losses specified as a transformation industry.

Examples

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()

earamendia/ECCTools documentation built on May 12, 2023, 2:12 a.m.