Calculates the share of heat supplied by each fossil fuel within each fossil fuel group
calc_shares_heat_by_ff_group.Rd
This function calculates the share of heat supplied by each fossil fuel within each fossil fuel group, for the two following fossil fuel groups "Oil and gas products", and "All fossil fuels". So it gives the share supplied by respectively Coal products, Oil products, and Natural gas, in each of those groups. The shares then add up to unity necessarily.
Usage
calc_shares_heat_by_ff_group(
.tidy_iea_df,
supply_mats_list = c(IEATools::psut_cols$V),
matnames = IEATools::mat_meta_cols$matnames,
product.group = "Product.Group",
share = "Share",
energy.stage = "Energy.stage",
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,
product = IEATools::iea_cols$product,
e.dot = IEATools::iea_cols$e_dot,
product_without_origin = "product_without_origin",
non_energy_uses = "Non_Energy_Uses"
)
Arguments
- .tidy_iea_df
The name of the
.tidy_iea_df
for which the share of heat supplied by each fossil fuel need to be calculated.- supply_mats_list
The list of the supply matrices to be used for calculating the heat supply mix. Default is
c(IEATools::psut_cols$V)
.- matnames
The name of the column containing matrices names. Default is "matnames".
- product.group
The name of the column containing the product group name. Default is "Product.Group".
- share
The name of the column containing the shares of each fossil fuel within the electricity supply. Default is "Share".
- energy.stage
The name of the column containing the energy stage. Default is "Energy.stage".
- country, method, energy_type, last_stage, year, unit, product, e.dot
See
IEATools::iea_cols
.- product_without_origin
The name of the column containing the product name without the product origin. Default is "product_without_origin"
- non_energy_uses
The name of the column indicating whether non-energy uses are included the calculation. Default is "Non_Energy_Uses".
Examples
ECCTools::tidy_AB_data %>%
IEATools::add_psut_matnames() %>%
ECCTools::transform_to_dta() %>%
calc_shares_heat_by_ff_group()
#> # A tibble: 0 × 10
#> # ℹ 10 variables: Country <chr>, Method <chr>, Energy.type <chr>,
#> # Last.stage <chr>, Year <dbl>, Product.Group <chr>, Energy.stage <chr>,
#> # Product <chr>, Share <dbl>, Non_Energy_Uses <chr>