Reassign Transformation process sinks to Non-energy use
tp_sinks_to_nonenergy.Rd
Transformation processes that consume energy without producing any energy are called
"transformation process sinks".
See tp_sinks_sources()
for information about why transformation process sinks are problematic.
This function reclassifies energy flowing into transformation process sinks
as non_energy_flow
, by default "Non-energy use in industry/transformation/energy".
Usage
tp_sinks_to_nonenergy(
.tidy_iea_df,
ledger_side = IEATools::iea_cols$ledger_side,
consumption = IEATools::ledger_sides$consumption,
flow_aggregation_point = IEATools::iea_cols$flow_aggregation_point,
non_energy_flow_agg_point = IEATools::tfc_flows$non_energy_use,
transformation_processes = IEATools::tfc_compare_flows$transformation_processes,
eiou = IEATools::tfc_compare_flows$energy_industry_own_use,
flow = IEATools::iea_cols$flow,
non_energy_flow =
IEATools::non_energy_flows$non_energy_use_industry_transformation_energy,
product = IEATools::iea_cols$product,
e_dot = IEATools::iea_cols$e_dot
)
Arguments
- .tidy_iea_df
a tidy data frame containing IEA extended energy balance data
- ledger_side
the name of the ledger side column in
.tidy_iea_df
. Default is "Ledger.side
".- consumption
a string identifying the consumption side of the ledger. Default is "
Consumption
".- flow_aggregation_point
the name of the flow aggregation point column in
.tidy_iea_df
. Default is "Flow.aggregation.point
".- non_energy_flow_agg_point
the name of the aggregation point where transformation process sinks will be reassigned. Default is "
Non-energy use
".- transformation_processes
a string that identifies transformation processes in the
flow_aggregation_point
column. Default is "Transformation processes
".- eiou
a string that identifies energy industry own use in the
flow_aggregation_point
column. Default is "Energy industry own use
".- flow
the name of the flow column in
.tidy_iea_df
. Default is "Flow
".- non_energy_flow
a sting identifying non-energy flows. Default is "
Non-energy use industry/transformation/energy
".- product
the name of the product column in
.tidy_iea_df
. Default is "Product
".- e_dot
the name of the energy rate column in
.tidy_iea_df
. Default is "Edot
".
Examples
library(dplyr)
DF <- data.frame(
LedgerSide = c("Supply", "Supply", "Supply", "Consumption"),
FlowAggregationPoint = c("Transformation processes",
"Transformation processes",
"Transformation processes",
"Non-energy use"),
Flow = c("Automobiles", "Automobiles", "Furnaces",
"Non-energy use industry/transformation/energy"),
Product = c("Petrol", "MD", "Coal", "Coal"),
Edot = c(-1, 1, -2, 8),
stringsAsFactors = FALSE
) %>%
mutate(
Method = "PCM",
LastStage = "Final",
EnergyType = "E",
Country = "Bogus",
Year = 1971
)
DF
#> LedgerSide FlowAggregationPoint
#> 1 Supply Transformation processes
#> 2 Supply Transformation processes
#> 3 Supply Transformation processes
#> 4 Consumption Non-energy use
#> Flow Product Edot Method LastStage
#> 1 Automobiles Petrol -1 PCM Final
#> 2 Automobiles MD 1 PCM Final
#> 3 Furnaces Coal -2 PCM Final
#> 4 Non-energy use industry/transformation/energy Coal 8 PCM Final
#> EnergyType Country Year
#> 1 E Bogus 1971
#> 2 E Bogus 1971
#> 3 E Bogus 1971
#> 4 E Bogus 1971
DF %>%
tp_sinks_to_nonenergy()
#> LedgerSide FlowAggregationPoint
#> 1 Supply Transformation processes
#> 2 Supply Transformation processes
#> 3 Consumption Non-energy use
#> Flow Product Edot Method LastStage
#> 1 Automobiles Petrol -1 PCM Final
#> 2 Automobiles MD 1 PCM Final
#> 3 Non-energy use industry/transformation/energy Coal 10 PCM Final
#> EnergyType Country Year
#> 1 E Bogus 1971
#> 2 E Bogus 1971
#> 3 E Bogus 1971