specify_non_energy_use | R Documentation |
For some countries and years, Non-energy use details are supplied
by "Memo:" fields.
We use those details if they exist.
This function assess the energy balance of
replacing "Non-energy use industry/transformation/energy" by
"Non-energy use in <
specify_non_energy_use(
.iea_df,
country = IEATools::iea_cols$country,
year = IEATools::iea_cols$year,
method = IEATools::iea_cols$method,
energy_type = IEATools::iea_cols$energy_type,
unit = IEATools::iea_cols$unit,
ledger_side = IEATools::iea_cols$ledger_side,
last_stage = IEATools::iea_cols$last_stage,
flow_aggregation_point = IEATools::iea_cols$flow_aggregation_point,
flow = IEATools::iea_cols$flow,
product = IEATools::iea_cols$product,
non_energy_use = IEATools::aggregation_flows$non_energy_use,
non_energy_flows_industry_transformation_energy =
IEATools::non_energy_flows[["non_energy_use_industry_transformation_energy"]],
memo_non_energy_use_in_industry_not_elsewhere_specified =
IEATools::memo_non_energy_flows[["memo_non_energy_use_in_industry_not_elsewhere_specified"]],
non_energy_use_in_industry_not_elsewhere_specified = sub(pattern = paste0("^", memo),
replacement = "", memo_non_energy_use_in_industry_not_elsewhere_specified),
memo = IEATools::memo_aggregation_flow_prefixes$memo,
memo_non_energy_flows_industry =
IEATools::memo_non_energy_flows$memo_non_energy_use_in_industry,
memo_non_energy_use_in = "Memo: Non-energy use in ",
non_energy_use_in = sub(pattern = paste0("^", memo), replacement = "", x =
memo_non_energy_use_in),
total = IEATools::memo_aggregation_product_prefixes$total,
.values = IEATools::template_cols$.values,
.values_summarised = paste0(.values, "_summarised"),
.diff = ".diff",
tol = 1e-06
)
.iea_df |
A data frame of IEA data,
created by |
country , year , method , energy_type , unit , ledger_side , last_stage , flow_aggregation_point , flow , product |
See |
non_energy_use |
See |
non_energy_flows_industry_transformation_energy |
See |
memo_non_energy_use_in_industry_not_elsewhere_specified |
See |
non_energy_use_in_industry_not_elsewhere_specified |
Same as |
memo |
A string prefix for memo flows.
Default is |
memo_non_energy_flows_industry |
See |
memo_non_energy_use_in |
A prefix for specific Non-energy use flows. Default is "Memo: Non-energy use in ". |
non_energy_use_in |
Same as |
total |
See |
.values |
An internal column name.
Default is |
.values_summarised |
An internal column name.
Default is |
.diff |
An internal column name. Default is ".diff". |
tol |
The tolerance for differences from |
Note that energy balance checks are not performed on the incoming .iea_df
,
but that the specification process itself
ensures that the modifications, themselves, are balanced.
In other words, specifying Non-energy use flows
will not change the energy balance of the incoming .iea_df
data frame.
This function does not promise the resulting data frame
is internally consistent.
Rather, this function should be considered a step along the path to
creating a coherent data frame of IEA data.
Specifically,
this function does not specify aggregation or Memo: flows, so
coherence will be achieved again only after
remove_agg_memo_flows()
is called.
Note that load_tidy_iea_df(specify_non_energy_flows = TRUE)
correctly calls remove_agg_memo_flows()
internally, so
using load_tidy_iea_df()
is preferred to calling specify_non_energy_use()
directly.
.iea_df
with specified Non-energy use
s, where possible.
sample_iea_data_path() %>%
iea_df() %>%
rename_iea_df_cols() %>%
clean_iea_whitespace() %>%
augment_iea_df() %>%
specify_non_energy_use()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.