fu_allocation_template: Create a template for analysis of final-to-useful...

View source: R/templates.R

fu_allocation_templateR Documentation

Create a template for analysis of final-to-useful transformation processes

Description

This function creates a blank template for final-to-useful energy transformation process analysis. The template is a data frame derived from IEA extended energy balance data (.tidy_iea_df), which gives both energy industry own use and final demand for final energy carriers. From the IEA's final energy information, templates are created for conversion to useful energy carriers. Final energy consumed by each final demand sector or transformation process machine is allocated to final-to-useful machines and converted to useful energy at some efficiency. The allocation fractions are to be supplied by the analyst by filling blanks in the template.

Usage

fu_allocation_template(
  .tidy_iea_df,
  energy_type = "Energy.type",
  energy = "E",
  last_stage = "Last.stage",
  final = "Final",
  year = "Year",
  ledger_side = "Ledger.side",
  consumption = "Consumption",
  flow_aggregation_point = "Flow.aggregation.point",
  eiou = "Energy industry own use",
  non_energy_use = "Non-energy use",
  tfc = "Total final consumption",
  tpes = "Total primary energy supply",
  flow = "Flow",
  product = "Product",
  destination = "Destination",
  quantity = "Quantity",
  e_dot = "E.dot",
  e_dot_total = paste0(e_dot, ".total"),
  perc_unit_string = "[%]",
  e_dot_perc = paste(e_dot, perc_unit_string),
  maximum_values = "Maximum.values",
  year_for_maximum_values = 0,
  ef_product = "Ef.product",
  allocation_var = "C_",
  n_allocation_rows = 4,
  machine = "Machine",
  eu_product = "Eu.product",
  arrange = TRUE,
  .value = ".value"
)

Arguments

.tidy_iea_df

a tidy data frame containing IEA extended energy balance data

energy_type

the name of the energy type column. Default is "Energy.type".

energy

the string identifier for energy (as opposed to exergy) in the energy_type column. Default is "E".

last_stage

the name of the last stage column. Default is "Last.stage".

final

the string identifier for final energy (as Last.stage). Default is "Final".

year

the name of the year column. Default is "Year".

ledger_side

the name of the ledger side column. Default is "Ledger.side".

consumption

the string identifier for the consumption side of the ledger. Default is "Consumption".

flow_aggregation_point

the name of the flow aggregation point column. Default is "Flow.aggregation.point".

eiou

the string identifier for energy industry own use in flow_aggregation_point. Default is "Energy industry own use".

non_energy_use

string identifier for non-energy use in flow_aggregation_point. Default is "Non-energy use".

tfc

the string identifier for total final consumption. Default is "Total final consumption".

tpes

the string identifier for total primary energy supply. Default is "Total primary energy supply".

flow

the name of the flow column. Default is "Flow".

product

the name of the product column. Default is "Product".

destination

the name for the destination column. Default is "Destination".

quantity

the name of the quantity column. Default is "Quantity".

e_dot

the name of the energy flow rate column. Default is "E.dot".

e_dot_total

the string identifier for total energy. Default is "E.dot.total".

perc_unit_string

the string used to indicate percentages. Default is "⁠[%]⁠".

e_dot_perc

the string identifier for energy percentage. Default is "E.dot.perc".

maximum_values

the name for the maximum energy values column. Default is "Maximum values".

year_for_maximum_values

an integer for the first year (in which maximum values will be stored before renaming the column to maximum_values). Default is 0.

ef_product

the name of the final energy carrier column. Default is "Ef product".

allocation_var

the string identifier for the allocation percentage column. Default is "C_".

n_allocation_rows

an integer stating how many allocation rows are desired. Default is 3.

machine

the name of the column of final-to-useful transformation process machines. Default is "Machine".

eu_product

the name of the useful energy carrier column. Default is "Eu product".

arrange

a boolean telling whether to arranged the rows and columns (using arrange_iea_fu_allocation_template()) before returning. Default is TRUE.

.value

the name of a temporary value column added to .tidy_iea_df. A .value column must not be present in .tidy_iea_df. Default is ".value".

Details

Non-energy use is removed from .tidy_iea_df before creating the template.

Value

a data frame containing the EIOU template

Examples

load_tidy_iea_df() %>% 
  specify_all() %>% 
  fu_allocation_template()

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