tidy_fu_allocation_table: Tidy a final-to-useful allocation table

View source: R/tables.R

tidy_fu_allocation_tableR Documentation

Tidy a final-to-useful allocation table

Description

Analysts fill final-to-useful (FU) allocation tables in a human-readable format provided by fu_allocation_template() and write_fu_allocation_template(). The templates are not tidy. However, most code uses in IEATools requires tidy data frames. This function converts an FU allocation table with years in columns to a tidy data frame with years in a year column and C values in a .values column. Identifiers for the C values are in the quantity column.

Usage

tidy_fu_allocation_table(
  .fu_allocation_table,
  year = IEATools::iea_cols$year,
  e_dot = IEATools::iea_cols$e_dot,
  unit = IEATools::iea_cols$unit,
  e_dot_perc = IEATools::template_cols$e_dot_perc,
  quantity = IEATools::template_cols$quantity,
  maximum_values = IEATools::template_cols$maximum_values,
  .values = IEATools::template_cols$.values
)

Arguments

.fu_allocation_table

The final-to-useful allocation table to be tidied.

year, e_dot, unit

See IEATools::iea_cols.

e_dot_perc, quantity, maximum_values, .values

See IEATools::template_cols.

Details

If .fu_allocation_table is already tidy, it is returned unmodified.

Value

A tidy version of .fu_allocation_table.

Examples

load_fu_allocation_data() %>% 
  tidy_fu_allocation_table()

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