non_energy_uses_to_balancing: Relocates non-energy uses flows in the balancing matrix

View source: R/cleans.R

non_energy_uses_to_balancingR Documentation

Relocates non-energy uses flows in the balancing matrix

Description

This function relocates non-energy uses to the balancing matrix B. The Balancing matrix is akin to an additional final demand matrix.

Usage

non_energy_uses_to_balancing(
  .tidy_iea_df,
  flow = IEATools::iea_cols$flow,
  matnames = IEATools::mat_meta_cols$matnames,
  ledger_side = IEATools::iea_cols$ledger_side,
  e_dot = IEATools::iea_cols$e_dot,
  non_energy_uses = IEATools::tfc_flows$non_energy_use,
  balancing_matrix = "B"
)

Arguments

.tidy_iea_df

The .tidy_iea_df for which non-energy use flows need to be relocated in the Balancing matrix.

flow, e_dot, ledger_side

See IEATools::iea_cols.

matnames

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

non_energy_uses

The string that identifies non-energy uses. Default is IEATools::tfc_flows$non_energy_use.

balancing_matrix

The name of the Balancing matrix. Default is "B".

Details

See the Balancing matrix vignette for more information. Note: one needs to add the column containing matrices names first, most likely using the IEATools::add_psut_matnames() function.

Value

A .tidy_iea_df with non-energy uses flows relocated in the Balancing matrix.

Examples

tidy_AB_data %>%
tibble::add_row(
 Country = "A",
 Method = "PCM",
 Energy.type = "E",
 Last.stage = "Final",
 Year = 2018,
 Ledger.side = "Supply",
 Flow.aggregation.point = "Consumption",
 Flow = "Non-energy use in whatever sector",
 Product = "Electricity",
 Unit = "ktoe",
 E.dot = 10,
) %>%
IEATools::add_psut_matnames() %>%
dplyr::filter(matnames == "B")

earamendia/ECCTools documentation built on May 12, 2023, 2:12 a.m.