specify_primary_production: Specify primary production industries

View source: R/specify.R

specify_primary_productionR Documentation

Specify primary production industries

Description

The IEA extended energy balances include some Flows 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 = "Liquefaction (LNG) / 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 "E.dot".

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.

Details

By default, the following changes are made to .tidy_iea_df:

  1. Energy industry own use for ⁠Liquefaction (LNG) / regasification plants⁠ is reassigned to ⁠Oil and gas extraction⁠.

  2. Each Production flow is replaced by a ⁠Resources [of Product]⁠ flow, which produces ⁠Product [from Resources]⁠.

  3. 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().

Value

A .tidy_iea_df with adjusted production information for primary energy for both coal and coal products and oil and gas extraction

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, -Last.stage, -Ledger.side, -Unit)
# EIOU by "Liquefaction (LNG) / regasification plants" is reassigned to "Oil and gas extraction"
data.frame(
  Flow.aggregation.point = c("Energy industry own use"),
  Flow = c("Liquefaction (LNG) / regasification plants"), 
  Product = c("Natural gas"),
  E.dot = c(-42), 
  stringsAsFactors = FALSE
) %>% 
  specify_primary_production()

MatthewHeun/IEATools documentation built on Feb. 6, 2024, 3:29 p.m.