Skip to contents

This function calculates the final energy consumption of electricity from fossil fuel origin, by fossil fuel group. It does so by determining the total final consumption of electricity (determined from use matrices provided in list_use_mats) and then applying the share of electricity supplied by each fossil fuel group, which is determined from supply matrices provided in list_supply_mats.

Usage

calc_fec_from_ff_as_elec_by_group(
  .tidy_iea_df,
  list_use_mats = c(IEATools::psut_cols$Y, IEATools::psut_cols$U_eiou),
  list_supply_mats = c(IEATools::psut_cols$V),
  list_oil_products = IEATools::oil_and_oil_products,
  list_coal_products = IEATools::coal_and_coal_products,
  list_gas_products = IEATools::primary_gas_products,
  exports = IEATools::interface_industries$exports,
  losses = IEATools::tfc_compare_flows$losses,
  country = IEATools::iea_cols$country,
  method = IEATools::iea_cols$method,
  energy_type = IEATools::iea_cols$energy_type,
  last_stage = IEATools::iea_cols$last_stage,
  ledger_side = IEATools::iea_cols$ledger_side,
  flow_aggregation_point = IEATools::iea_cols$flow_aggregation_point,
  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",
  share = "Share",
  product_without_origin = "product_without_origin"
)

Arguments

.tidy_iea_df

The .tidy_iea_df for which final energy consumption of electricity by fossil fuel group needs to be determined.

list_use_mats

The list of matrices to be used for determining total final energy consumption of electricity. Default is c(IEATools::psut_cols$Y, IEATools::psut_cols$U_eiou).

list_supply_mats

The list of matrices to be used for determining the shares of supply of electricity by fossil fuel group. Default is c(IEATools::psut_cols$V).

list_oil_products

The list of oil products to be used when calculating the use shares. Default is IEATools::oil_and_oil_products.

list_coal_products

The list of coal products to be used when calculating the use shares. Default is IEATools::coal_and_coal_products.

list_gas_products

The list of gas products to be used when calculating the use shares. Default is IEATools::primary_gas_products.

exports

The character string identifying exports flows in the .tidy_iea_df. Default is IEATools::interface_industries$exports.

losses

The character string identifying losses flows in the .tidy_iea_df. Default is IEATools::tfc_compare_flows$losses.

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

See IEATools::iea_cols.

matnames

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

product.group

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

energy.stage

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

share

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

product_without_origin

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

Value

A tidy data frame containing the total final energy consumption of electricity, broken down by the supplying 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)

Examples

ECCTools::tidy_AB_data %>% 
   IEATools::add_psut_matnames() %>% 
   ECCTools::transform_to_dta() %>% 
   calc_fec_from_ff_as_elec_by_group()
#> # A tibble: 5 × 15
#> # Groups:   Country, Method, Energy.type, Last.stage, Year, Ledger.side,
#> #   Flow.aggregation.point, Flow, Product, Unit, matnames [5]
#>   Country Method Energy.type Last.stage  Year Ledger.side Flow.aggregation.point
#>   <chr>   <chr>  <chr>       <chr>      <dbl> <chr>       <chr>                 
#> 1 A       PCM    E           Final       2018 Consumption Industry              
#> 2 A       PCM    E           Final       2018 Supply      Energy industry own u…
#> 3 A       PCM    E           Final       2018 Supply      Energy industry own u…
#> 4 A       PCM    E           Final       2018 Supply      Energy industry own u…
#> 5 A       PCM    E           Final       2018 Supply      Energy industry own u…
#> # ℹ 8 more variables: Flow <chr>, Product <chr>, Unit <chr>, matnames <chr>,
#> #   product_without_origin <chr>, E.dot <dbl>, Product.Group <chr>,
#> #   Energy.stage <chr>