route_own_use_elect_chp_heat: Routes own use in electricity, chp, and heat plants EIOU flow...

View source: R/specify_tp_eiou.R

route_own_use_elect_chp_heatR Documentation

Routes own use in electricity, chp, and heat plants EIOU flow to main activity producer flows

Description

This function routes the "Own use in electricity, CHP and heat plants" Energy Industry Own Use flow to each of the three electricity, CHP and heat main activity producer plants. The function is called within the specify_all() function.

Usage

route_own_use_elect_chp_heat(
  .tidy_iea_df,
  split_using_shares_of = c("input", "output"),
  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,
  supply = IEATools::ledger_sides$supply,
  eiou = IEATools::aggregation_flows$energy_industry_own_use,
  transformation_processes = IEATools::aggregation_flows$transformation_processes,
  own_use_elect_chp_heat = IEATools::eiou_flows$own_use_elect_chp_heat_plants,
  main_act_producer_elect = IEATools::main_act_plants$main_act_prod_elect_plants,
  main_act_producer_chp = IEATools::main_act_plants$main_act_prod_chp_plants,
  main_act_producer_heat = IEATools::main_act_plants$main_act_prod_heat_plants,
  n_counting = ".n_counting",
  destination_flow = ".destination_flow",
  Total_main_activity_From_Func = ".Total_main_activity_From_Func",
  Total_per_main_activity_From_Func = ".Total_per_main_activity_From_Func",
  Share_per_main_activity_From_Func = ".Share_per_main_activity_From_Func"
)

Arguments

.tidy_iea_df

The .tidy_iea_df which flows need to be specified.

split_using_shares_of

A string that identifies which method is to be used for splitting the own_use_elect_chp_heat flow. Default is "input". The other valid value is "output". See details for more information.

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$flow.

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$flow.

supply

A string identifying "Supply" in the ledger_side column of the .tidy_iea_df. Default is IEATools::ledger_sides$supply.

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.

transformation_processes

A string identifying transformation processes in the flow_aggregation_point column of the .tidy_iea_df Default is IEATools::aggregation_flows$flow_aggregation_point.

own_use_elect_chp_heat

A string identifying "Own use in electricity, CHP and heat plants" in the flow column of the .tidy_iea_df. Default is IEATools::eiou_flows$own_use_elect_chp_heat_plants.

main_act_producer_elect

A string identifying "Main activity producer electricity plants" in the flow column of the .tidy_iea_df. Default is IEATools::main_act_plants$main_act_prod_elect_plants.

main_act_producer_chp

A string identifying "Main activity producer CHP plants" in the flow column of the .tidy_iea_df. Default is IEATools::main_act_plants$main_act_prod_chp_plants.

main_act_producer_heat

A string identifying "Main activity producer electricity plants" in the flow column of the .tidy_iea_df. Default is IEATools::main_act_plants$main_act_prod_heat_plants.

n_counting

The name of a temporary column created in .tidy_iea_df. Default is ".n_counting".

destination_flow

The name of a temporary column created in .tidy_iea_df. Default is ".destination_flow".

Total_main_activity_From_Func

The name of a temporary column created in .tidy_iea_df. Default is ".Total_main_activity_From_Func".

Total_per_main_activity_From_Func

The name of a temporary column created in .tidy_iea_df. Default is ".Total_per_main_activity_From_Func".

Share_per_main_activity_From_Func

The name of a temporary column created in .tidy_iea_df. Default is ".Share_per_main_activity_From_Func".

Details

The function either performs the routing using the share of outputs or of inputs of each of the three main activity producer industries.

The method is selected using the split_using_shares_of argument, to which either the have the "input" or "output" value can be passed.

When none of the main activity producer industries is present in the data frame, the "Own use in electricity, CHP and heat plants" flow is ascribed by default to the "Main activity producer electricity plant".

Value

A modified version of the .tidy_iea_df, in which the own_use_elect_chp_heat flow has been routed to the main activity producer industries.

Examples

library(dplyr)
load_tidy_iea_df() %>% 
  route_own_use_elect_chp_heat()

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