route_non_specified_eiou: Routes non specified EIOU flows to existing industries

View source: R/specify_tp_eiou.R

route_non_specified_eiouR Documentation

Routes non specified EIOU flows to existing industries

Description

This function routes the non-specified EIOU flow to other existing industries. It does so using the shares of EIOU use of the other EIOU industries. If no EIOU flow different from "Non-specified" is available in the .tidy_iea_df, then the "Non-specified" EIOU flow is kept as it is. 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_eiou(
  .tidy_iea_df,
  route_non_specified_eiou = 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,
  eiou = IEATools::aggregation_flows$energy_industry_own_use,
  non_spec = "Non-specified",
  negzeropos = ".negzeropos",
  n_counting = ".n_counting",
  Total_eiou_excl_nonspec_From_Func = ".Total_eiou_excl_nonspec_From_Func",
  EIOU_per_industry_From_Func = ".EIOU_per_industry_From_Func",
  Share_eiou_per_industry_From_Func = ".Share_eiou_per_industry_From_Func",
  destination_flow = ".destination_flow"
)

Arguments

.tidy_iea_df

The .tidy_iea_df which flows need to be specified.

route_non_specified_eiou

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 year column 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$e_dot.

eiou

A string identifying "Energy industry own use" in the flow_aggregation_point column of the .tidy_iea_df. Default is IEATools::aggregation_flows$energy_industry_own_use.

non_spec

A string identifying "Non-specified" 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_eiou_excl_nonspec_From_Func

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

EIOU_per_industry_From_Func

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

Share_eiou_per_industry_From_Func

The name of a temporary column added to the data frame. Default is ".Share_eiou_per_industry_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 the non-specified EIOU flow routed to existing industries.

Examples

library(dplyr)
load_tidy_iea_df() %>% 
  route_non_specified_eiou()

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