Skip to contents

This function calculates the share of use (using the matrices provided in the final_use_mats argument) of each energy product within each fossil fuel group, when including electricity and heat of fossil fuel origin in the calculations.

Usage

calc_shares_ff_by_group_inc_elec_heat(
  .tidy_iea_df,
  include_non_energy_uses = FALSE,
  final_use_mats = c(IEATools::psut_cols$Y, IEATools::psut_cols$U_eiou),
  list_oil_products = IEATools::oil_and_oil_products,
  list_coal_products = IEATools::coal_and_coal_products,
  list_gas_products = IEATools::primary_gas_products,
  product.group = "Product.Group",
  total_product_use = "Total_Product_Use",
  total_group_use = "Total_Group_Use",
  non_energy_uses = "Non_Energy_Uses",
  share = "Share",
  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,
  unit = IEATools::iea_cols$unit,
  e_dot = IEATools::iea_cols$e_dot,
  product = IEATools::iea_cols$product,
  boolean_non_energy_uses = "Boolean_Non_Energy_Uses",
  energy.stage = "Energy.stage",
  product_without_origin = "product_without_origin"
)

Arguments

.tidy_iea_df

The .tidy_iea_df for which the share of uses should be calculated.

include_non_energy_uses

A boolean indicating whether non-energy uses should be included in the calculation of the share of uses. Default is FALSE.

final_use_mats

The list of matrices to be used to calculate the share of uses. Default is c(IEATools::psut_cols$Y, IEATools::psut_cols$U_eiou).

list_oil_products

The list of oil products to be used for the shares calculations. Default is IEATools::oil_and_oil_products.

list_coal_products

The list of coal products to be used for the shares calculations. Default is IEATools::coal_and_coal_products.

list_gas_products

The list of gas products to be used for the shares calculations. Default is IEATools::primary_gas_products.

product.group

The name of the column containing the product group name. Default is "Product.Group".

total_product_use

The name of the column containing the total energy use by product. Default is "Total_Product_Use".

total_group_use

The name of the column containing the total energy use by fossil fuel group. Default is "Total_Group_Use".

non_energy_uses

The name of the column stating whether non-energy uses are included in the shares calculations. Default is "Non_Energy_Uses".

share

The name of the column containing the shares of each fossil fuel within the electricity supply. Default is "Share".

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

See IEATools::iea_cols.

boolean_non_energy_uses

The column name of a column containing a boolean stating whether non-energy uses are included in the shares calculations. Default is "Boolean_Non_Energy_Uses".

energy.stage

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

product_without_origin

The name of the column containing the product name without the product origin. Default is "product_without_origin"

Value

A .tidy_iea_df with the shares of use of each energy product within each fossil fuel group.

Details

The function can work both on a single country Energy Conversion Chain of Domestic Technology Assumption type, or with a multi-regional Energy Conversion Chain for instance using the Global Market Assumption. The input data frame will have to be slightly adapted in this case (for an example see the tests related to the function). Non-energy uses can be included or excluded using the include_non_energy_uses argument.

Examples

ECCTools::tidy_AB_data %>% 
   IEATools::add_psut_matnames() %>% 
   ECCTools::transform_to_dta() %>% 
   calc_shares_ff_by_group_inc_elec_heat()
#> # A tibble: 13 × 14
#> # Groups:   Country, Method, Energy.type, Last.stage, Year, Product.Group,
#> #   Energy.stage [5]
#>    Country Method Energy.type Last.stage  Year Product                     Unit 
#>    <chr>   <chr>  <chr>       <chr>      <dbl> <chr>                       <chr>
#>  1 A       PCM    E           Final       2018 Blast furnace gas           ktoe 
#>  2 A       PCM    E           Final       2018 Coke oven coke              ktoe 
#>  3 A       PCM    E           Final       2018 Kerosene type jet fuel exc… ktoe 
#>  4 A       PCM    E           Final       2018 Motor gasoline excl. biofu… ktoe 
#>  5 A       PCM    E           Final       2018 Natural gas                 ktoe 
#>  6 A       PCM    E           Final       2018 Blast furnace gas           ktoe 
#>  7 A       PCM    E           Final       2018 Coke oven coke              ktoe 
#>  8 A       PCM    E           Final       2018 Kerosene type jet fuel exc… ktoe 
#>  9 A       PCM    E           Final       2018 Motor gasoline excl. biofu… ktoe 
#> 10 A       PCM    E           Final       2018 Natural gas                 ktoe 
#> 11 A       PCM    E           Final       2018 Kerosene type jet fuel exc… ktoe 
#> 12 A       PCM    E           Final       2018 Motor gasoline excl. biofu… ktoe 
#> 13 A       PCM    E           Final       2018 Natural gas                 ktoe 
#> # ℹ 7 more variables: product_without_origin <chr>, Total_Product_Use <dbl>,
#> #   Product.Group <chr>, Energy.stage <chr>, Total_Group_Use <dbl>,
#> #   Share <dbl>, Non_Energy_Uses <chr>