route_non_specified_tp: Routes non-specified transformation processes flows to...

View source: R/specify_tp_eiou.R

route_non_specified_tpR Documentation

Routes non-specified transformation processes flows to existing industries

Description

This function routes non-specified transformation processes flows to existing industries. It does so using the shares of product use and supply of the other transformation processes. If no transformation processes consume or supply a product that is present in the non-specified flows, then the flow remains non-specified. The function is called within the route_non_specified_flows() function. Note that the routing_non_specified_eiou parameter enables to switch on and off the routing of the non-specified EIOU flow.

Usage

route_non_specified_tp(
  .tidy_iea_df,
  route_non_specified_tp = TRUE,
  country = IEATools::iea_cols$country,
  flow_aggregation_point = IEATools::iea_cols$flow_aggregation_point,
  flow = IEATools::iea_cols$flow,
  ledger_side = IEATools::iea_cols$ledger_side,
  method = IEATools::iea_cols$method,
  energy_type = IEATools::iea_cols$energy_type,
  last_stage = IEATools::iea_cols$last_stage,
  year = IEATools::iea_cols$year,
  product = IEATools::iea_cols$product,
  unit = IEATools::iea_cols$unit,
  e_dot = IEATools::iea_cols$e_dot,
  transformation_processes = IEATools::aggregation_flows$transformation_processes,
  non_spec = "Non-specified",
  negzeropos = ".negzeropos",
  n_counting = ".n_counting",
  Total_input_output_by_prod_excl_nonspec = ".Total_input_output_by_prod_excl_nonspec",
  Input_output_by_prod_per_tp = ".Input_output_by_prod_per_tp",
  Share_input_output_by_prod_per_tp = ".Share_input_output_by_prod_per_tp",
  destination_flow = ".destination_flow"
)

Arguments

.tidy_iea_df

The .tidy_iea_df which flows need to be specified.

route_non_specified_tp

A boolean indicating whether non-specified EIOU flows should be redirected to other existing industries. If FALSE, the function returns the input data frame. Default is TRUE.

country

The name of the country column in the .tidy_iea_df. Default is IEATools::iea_cols$country.

flow_aggregation_point

The name of the flow aggregation point column in the .tidy_iea_df. Default is IEATools::iea_cols$flow_aggregation_point.

flow

The name of the flow column in the .tidy_iea_df. Default is IEATools::iea_cols$flow.

ledger_side

The name of the ledger side column in the .tidy_iea_df. Default is IEATools::iea_cols$ledger_side.

method

The name of the method column in the .tidy_iea_df. Default is IEATools::iea_cols$method.

energy_type

The name of the energy type column in the .tidy_iea_df. Default is IEATools::iea_cols$energy_type.

last_stage

The name of the last stage column in the .tidy_iea_df. Default is IEATools::iea_cols$last_stage.

year

The name of the country year in the .tidy_iea_df. Default is IEATools::iea_cols$year.

product

The name of the product column in the .tidy_iea_df. Default is IEATools::iea_cols$product.

unit

The name of the unit column in the .tidy_iea_df. Default is IEATools::iea_cols$unit.

e_dot

The name of the energy column in the .tidy_iea_df. Default is IEATools::iea_cols$energy.

transformation_processes

A string that identifies "Transformation processes" in the flow_aggregation_point column of the .tidy_iea_df. Default is IEATools::aggregation_flows$transformation_processes.

non_spec

A string that identifies "Non-specified" flows in the flow column of the .tidy_iea_df. Default is "Non-specified".

negzeropos

The name of a temporary column added to the data frame. Default is ".negzeropos".

n_counting

The name of a temporary column added to the data frame. Default is ".n_counting".

Total_input_output_by_prod_excl_nonspec

The name of a temporary column added to the data frame. Default is ".Total_input_output_by_prod_excl_nonspec_From_Func".

Input_output_by_prod_per_tp

The name of a temporary column added to the data frame. Default is ".Input_output_by_prod_per_tp_From_Func".

Share_input_output_by_prod_per_tp

The name of a temporary column added to the data frame. Default is ".Share_input_output_by_prod_per_tp_From_Func".

destination_flow

The name of a temporary column added to the data frame. Default is ".destination_flow".

Value

A modified version of the .tidy_iea_df with non-specified transformation processes flows routes to existing industries.

Examples

library(dplyr)
load_tidy_iea_df() %>% 
  route_non_specified_tp()

MatthewHeun/IEATools documentation built on Feb. 6, 2024, 3:29 p.m.