arrange_iea_fu_allocation_template | R Documentation |
It is helpful to sort rows and columns of a final-to-useful allocation template
in reasonable ways to assist analysts.
This function sorts rows (top-to-bottom) by default in the same order as appears in the IEA extended energy balance data.
Other orderings can be specified with the fap_flow_order
and ef_product_order
arguments.
It sorts columns (left-to-right) in the order of energy flow through the energy conversion chain.
arrange_iea_fu_allocation_template(
.fu_allocation_template,
rowcol = c("both", "row", "col"),
ledger_side = IEATools::iea_cols$ledger_side,
flow_aggregation_point = IEATools::iea_cols$flow_aggregation_point,
ef_product = IEATools::template_cols$ef_product,
machine = IEATools::template_cols$machine,
eu_product = IEATools::template_cols$eu_product,
destination = IEATools::template_cols$destination,
unit = IEATools::iea_cols$unit,
fap_dest_order = IEATools::fap_flows,
ef_product_order = IEATools::products,
quantity = IEATools::template_cols$quantity,
maximum_values = IEATools::template_cols$maximum_values,
.temp_sort = ".fap_flow",
.clean_ef_product = ".clean_Ef_product"
)
.fu_allocation_template |
the final-to-useful allocation template created by |
rowcol |
one of "both", "row", or "col" to indicate whether rows, columns, or both should be arranged. Default is "both". |
ledger_side |
the ledger side column in |
flow_aggregation_point |
the flow aggregation point column in |
ef_product |
the name of the final energy column in |
machine |
the name of the machine column in |
eu_product |
the name of the useful energy product column in |
destination |
the name of the destination column in |
unit |
the name of the unit in |
fap_dest_order |
the desired order for the combination of |
ef_product_order |
the desired order for final energy products in |
quantity |
the name of the quantity column in |
maximum_values |
the name of the maximum value column |
.temp_sort |
the name of a temporary column to be added to |
.clean_ef_product |
the name of a temporary column to be added to |
When sorting rows,
the flow_allocation_point
, flow
, and product
columns are considered.
Internally, this function figures out which columns are metadata columns
and groups on those columns before applying the row ordering.
If you want to preserve ordering by metadata, be sure to set factor levels on metadata columns prior to calling this function.
When sorting columns, the order of energy flows through the energy conversion chain is considered. The column order is:
metadata columns,
final energy product (EfProduct
).
Machine (the final-to-useful transformation process),
useful energy product (EuProduct
),
destination where the useful energy now flows,
years (in columns), and
allocations (C_x rows).
An row- and/or column-ordered version of .fu_allocation_template
Template <- load_tidy_iea_df() %>%
specify_all() %>%
fu_allocation_template()
Template
Template %>%
arrange_iea_fu_allocation_template()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.