Skip to contents

The function calculates primary energy supply for each primary stage fossil fuel group (coal products, oil and gas products, all fossil fuels). It does not disaggregate the oil and gas products group because they are jointly extracted, so it is not robust to separate them in EROI calculations, at least from the IEA data we use here. By default, it uses flows in the V matrix and selects primary energy products to determine primary energy production flows.

Usage

calc_primary_products_supply_by_group(
  .tidy_iea_df,
  primary_production_mats = c(IEATools::psut_cols$V),
  list_primary_oil_products = IEATools::primary_oil_products,
  list_primary_coal_products = IEATools::primary_coal_products,
  list_primary_gas_products = IEATools::primary_gas_products,
  country = IEATools::iea_cols$country,
  method = IEATools::iea_cols$method,
  energy_type = IEATools::iea_cols$energy_type,
  last_stage = IEATools::iea_cols$last_stage,
  year = IEATools::iea_cols$year,
  product = IEATools::iea_cols$product,
  unit = IEATools::iea_cols$unit,
  flow = IEATools::iea_cols$flow,
  e_dot = IEATools::iea_cols$e_dot,
  matnames = IEATools::mat_meta_cols$matnames,
  product.group = "Product.Group",
  energy.stage = "Energy.stage",
  total_group_supply = "Total_Group_Supply",
  product_without_origin = "product_without_origin"
)

Arguments

.tidy_iea_df

A tidy iea data frame for which the primary energy supply needs to be calculated.

primary_production_mats

A list containing the names of matrices containing primary production flows. Default is c(IEATools::psut_cols$V).

list_primary_oil_products

A list containing the names of primary oil products. Default is IEATools::primary_oil_products.

list_primary_coal_products

A list containing the names of primary coal products. Default is IEATools::primary_coal_products,.

list_primary_gas_products

A list containing the names of primary gas products. Default is IEATools::primary_gas_products,.

country, method, energy_type, last_stage, year, product, unit, flow, e_dot

See IEATools::iea_cols.

matnames

The column name of the column having matrices names. Default is IEATools::mat_meta_cols$matnames.

product.group

The column name of the column defining the fossil fuel group. Default is "Product.Group".

energy.stage

The column name of the column defining the energy stage. Default is "Energy.stage".

total_group_supply

Column name containing total energy supply by product group. Default is "Total_Group_Supply".

product_without_origin

Column name containing the name of the product excluding the country of origin. Helpful for doing calculations with Global Market Assumption. Default is "product_without_origin".

Value

A tidy data frame returning the total primary energy supply by fossil fuel group.

Examples

ECCTools::tidy_AB_data %>% 
   IEATools::add_psut_matnames() %>% 
   ECCTools::transform_to_dta() %>% 
   calc_primary_products_supply_by_group()
#> # A tibble: 3 × 9
#> # Groups:   Country, Method, Energy.type, Last.stage, Year, Product.Group,
#> #   Energy.stage [3]
#>   Country Method Energy.type Last.stage  Year Product.Group   Energy.stage Unit 
#>   <chr>   <chr>  <chr>       <chr>      <dbl> <chr>           <chr>        <chr>
#> 1 A       PCM    E           Final       2018 Coal products   Primary      ktoe 
#> 2 A       PCM    E           Final       2018 Oil and gas pr… Primary      ktoe 
#> 3 A       PCM    E           Final       2018 All fossil fue… Primary      ktoe 
#> # ℹ 1 more variable: Total_Group_Supply <dbl>