specify_primary_production | R Documentation |
The IEA extended energy balances include
some Flow
s that identify Energy industry own use
(EIOU),
the consumption of energy by energy-producing industries.
But some primary production industries that receive EIOU do not produce anything.
For example, Coal mines
receive electricity
but there are no Coal mines
that produce coal.
Rather, the generic Production
industry produces coal.
This function solves that problem by
replacing the generic Production
industry with
specific industries.
specify_primary_production(
.tidy_iea_df,
ledger_side = IEATools::iea_cols$ledger_side,
flow_aggregation_point = IEATools::iea_cols$flow_aggregation_point,
flow = IEATools::iea_cols$flow,
product = IEATools::iea_cols$product,
e_dot = IEATools::iea_cols$e_dot,
list_primary_coal_products = IEATools::primary_coal_products,
list_primary_oil_products = IEATools::primary_oil_products,
list_primary_gas_products = IEATools::primary_gas_products,
production = IEATools::tpes_flows$production,
coal_mines = IEATools::industry_flows$coal_mines,
oil_extraction = IEATools::industry_flows$oil_extraction,
gas_extraction = IEATools::industry_flows$natural_gas_extraction,
liquefaction_regas = IEATools::eiou_flows$liquefaction_regasification_plants,
liquefaction_regas_reassign = IEATools::industry_flows$natural_gas_extraction,
transformation_processes = IEATools::aggregation_flows$transformation_processes,
resources = IEATools::tpes_flows$resources,
resource_products_notation = RCLabels::from_notation,
resources_flow_notation = RCLabels::of_notation,
manufacture = "Manufacture",
manufacture_flow_notation = RCLabels::of_notation
)
.tidy_iea_df |
An IEA data frame whose columns have been renamed by |
ledger_side , flow , product , flow_aggregation_point |
See |
e_dot |
The name of the energy column in |
list_primary_coal_products |
The list of primary coal products for which the production industry needs to be changed.
Default is |
list_primary_oil_products |
The list of primary oil products for which the production industry needs to be changed.
Default is |
list_primary_gas_products |
The list of primary gas products for which the production industry needs to be changed.
Default is |
production |
A string identifying production in the flow column. Default is " |
coal_mines |
The name of the new industry that produces primary coal products.
Default is |
oil_extraction |
The name of the new industry that produces primary oil and gas products.
Default is |
gas_extraction |
The name of the new industry that produces primary oil and gas products.
Default is |
liquefaction_regas |
A string identifying liquefaction and regasification plants. Default is "Liquefaction (LNG) / regasification plants". |
liquefaction_regas_reassign |
A string identifying the industry to which EIOU into |
transformation_processes |
A string identifying transformation processes in the flow column of |
resources |
A string identifying resource industries to be added to |
resource_products_notation |
The notation to be used for defining products coming from the new resource industries.
E.g., the Crude oil product will be called "Crude oil [from Resources]".
Default is |
resources_flow_notation |
The notation to be used for defining the new resource industries.
E.g., the Crude oil resource will be called "Resources [of Crude oil]".
Default is |
manufacture |
The name of the industries that convert resource-products \(inputs\) into actual products \(outputs\), when a corresponding a corresponding industry does not exist by default in IEA data. Default is "Manufacture". |
manufacture_flow_notation |
The notation to be used for the newly created manufacture industries
\(each manufacturing industry is specified\) by the product it manufactures.
Default is |
By default, the following changes are made to .tidy_iea_df
:
Energy industry own use for Liquefaction (LNG) / regasification plants
is
reassigned to Oil and gas extraction
.
Each Production
flow is replaced by a Resources [of Product]
flow,
which produces Product [from Resources]
.
For each Production
flow, a manufacturing flow, that takes as input
the Product [from Resources]
supplied by the new Resources [of Product]
,
and that produces the given Product
, is added. The name of the manufacturing industry
is Coal mines
for coal_and_coal_products
, Oil and gas extraction
for oil_and_gas_products
,
and Manufacture [of Product]
for all other products.
Users can specify other changes by adjusting the default argument values.
Be sure to call this function after calling augment_iea_df()
or
load_tidy_iea_df()
.
A .tidy_iea_df
with adjusted production information for primary energy
for both coal and coal products and oil and gas extraction
library(dplyr)
load_tidy_iea_df() %>%
specify_primary_production() %>%
add_psut_matnames() %>%
dplyr::filter(Flow == "Coal mines" | stringr::str_detect(Flow, "Resources")) %>%
select(-Method, -LastStage, -LedgerSide, -Unit)
# EIOU by "Liquefaction (LNG) / regasification plants" is reassigned to "Oil and gas extraction"
data.frame(
FlowAggregationPoint = c("Energy industry own use"),
Flow = c("Liquefaction (LNG) / regasification plants"),
Product = c("Natural gas"),
Edot = c(-42),
stringsAsFactors = FALSE
) %>%
specify_primary_production()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.