Specify primary production industries
specify_primary_production.Rd
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.
Usage
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
)
Arguments
- .tidy_iea_df
An IEA data frame whose columns have been renamed by
rename_iea_df_cols()
.- ledger_side, flow, product, flow_aggregation_point
See
IEATools::iea_cols
.- e_dot
The name of the energy column in
.tidy_iea_df
. Default is "Edot
".- list_primary_coal_products
The list of primary coal products for which the production industry needs to be changed. Default is
IEATools::primary_coal_products
.- list_primary_oil_products
The list of primary oil products for which the production industry needs to be changed. Default is
IEATools::primary_oil_products
.- list_primary_gas_products
The list of primary gas products for which the production industry needs to be changed. Default is
IEATools::primary_gas_products
.- production
A string identifying production in the flow column. Default is "
Production
".- coal_mines
The name of the new industry that produces primary coal products. Default is
IEATools::industry_flows$coal_mines
.- oil_extraction
The name of the new industry that produces primary oil and gas products. Default is
IEATools::industry_flows$oil_extraction
.- gas_extraction
The name of the new industry that produces primary oil and gas products. Default is
IEATools::industry_flows$natural_gas_extraction
.- 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
liquefaction_regas
will be reassigned. Default is "Natural gas extraction".- transformation_processes
A string identifying transformation processes in the flow column of
.tidy_iea_df
. Default is "Transformation processes".- resources
A string identifying resource industries to be added to
.tidy_iea_df
. Default is "Resources
".- 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
RCLabels::from_notation
.- 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
RCLabels::of_notation
.- 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
RCLabels::of_notation
.
Value
A .tidy_iea_df
with adjusted production information for primary energy
for both coal and coal products and oil and gas extraction
Details
By default, the following changes are made to .tidy_iea_df
:
Energy industry own use for
Liquefaction (LNG) / regasification plants
is reassigned toOil and gas extraction
.Each
Production
flow is replaced by aResources [of Product]
flow, which producesProduct [from Resources]
.For each
Production
flow, a manufacturing flow, that takes as input theProduct [from Resources]
supplied by the newResources [of Product]
, and that produces the givenProduct
, is added. The name of the manufacturing industry isCoal mines
forcoal_and_coal_products
,Oil and gas extraction
foroil_and_gas_products
, andManufacture [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()
.
Examples
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)
#> # A tibble: 23 × 8
#> Country EnergyType Year FlowAggregationPoint Flow Product Edot matnames
#> <chr> <chr> <dbl> <chr> <chr> <chr> <dbl> <chr>
#> 1 GHA E 1971 Total primary energy… Reso… Hydro … 1.05e4 R
#> 2 GHA E 1971 Total primary energy… Reso… Primar… 8.74e4 R
#> 3 GHA E 2000 Total primary energy… Reso… Hydro … 2.38e4 R
#> 4 GHA E 2000 Total primary energy… Reso… Primar… 1.63e5 R
#> 5 ZAF E 1971 Energy industry own … Coal… Electr… -2.19e3 U_EIOU
#> 6 ZAF E 1971 Total primary energy… Reso… Hard c… 1.38e6 R
#> 7 ZAF E 1971 Total primary energy… Reso… Hydro … 4.03e2 R
#> 8 ZAF E 1971 Total primary energy… Reso… Primar… 1.97e5 R
#> 9 ZAF E 1971 Transformation proce… Coal… Hard c… 1.38e6 V
#> 10 ZAF E 1971 Transformation proce… Coal… Hard c… -1.38e6 U_feed
#> # ℹ 13 more rows
# 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()
#> # A tibble: 1 × 4
#> FlowAggregationPoint Flow Product Edot
#> <chr> <chr> <chr> <dbl>
#> 1 Energy industry own use Natural gas extraction Natural gas -42