fu_allocation_table_completed | R Documentation |
A final-to-useful allocation table is complete iff all of the final energy flows for a country
are routed to a final-to-useful machine for each year in which those final energy flows exist.
Also, all routes need to add to 100%, within .tol
.
If not, an error is thrown.
fu_allocation_table_completed(
fu_allocation_table = NULL,
specified_iea_data,
country = IEATools::iea_cols$country,
year = IEATools::iea_cols$year,
ledger_side = IEATools::iea_cols$ledger_side,
e_dot = IEATools::iea_cols$e_dot,
unit = IEATools::iea_cols$unit,
flow = IEATools::iea_cols$flow,
product = IEATools::iea_cols$product,
flow_aggregation_point = IEATools::iea_cols$flow_aggregation_point,
consumption = IEATools::ledger_sides$consumption,
eiou = IEATools::tfc_compare_flows$energy_industry_own_use,
maximum_values = IEATools::template_cols$maximum_values,
quantity = IEATools::template_cols$quantity,
.values = IEATools::template_cols$.values,
C_source = IEATools::template_cols$c_source,
ef_product = IEATools::template_cols$ef_product,
destination = IEATools::template_cols$destination,
machine = IEATools::template_cols$machine,
e_u_product = IEATools::template_cols$eu_product,
e_dot_perc = IEATools::template_cols$e_dot_perc,
.tol = 1e-09,
.err = ".err"
)
fu_allocation_table |
The final-to-useful allocation table whose completeness is to be ascertained.
If |
specified_iea_data |
An IEA data frame from which final energy flows are gleaned.
This data frame should be generated by |
country , year , ledger_side , e_dot , unit , flow , product , flow_aggregation_point |
See |
consumption |
See |
eiou |
See |
maximum_values , quantity , .values , ef_product , destination , machine , e_u_product , e_dot_perc , C_source |
See |
.tol |
The tolerance for error when checking if all allocations for a particular final energy flow
sum to 1. Default is |
.err |
A column of error terms indicating distance between the sum of C values for a given final energy flow and 1. |
This function should really be named fu_allocation_table_completed?
, because it answers a question.
A boolean telling whether fu_allocation_table
is complete.
If FALSE
, a data frame of IEA final energy rows that have not been allocated
is stored in the "unallocated_rows" attribute of the return value.
Retrieve with attr(done, "unallocated_rows")
if the result of this function is assigned to the variable done
.
iea_data <- load_tidy_iea_df() %>%
specify_all()
fu_allocations <- load_fu_allocation_data()
fu_allocation_table_completed(fu_allocations, iea_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.