This function specified the Multi-Regional Supply (V) matrix. Only flows that belong to the Multi-Regional Supply matrix are returned, other flows are filtered out. Exceptions are flows akin to supply (with E.dot < 0) but that have been previously re-directed to the Balancing matrix by the analyst - those are also kept.

specify_MR_V(
  .tidy_iea_df,
  V_matrix = IEATools::psut_cols$V,
  balancing_matrix = "B",
  matnames = IEATools::mat_meta_cols$matnames,
  imports = IEATools::interface_industries$imports,
  country = IEATools::iea_cols$country,
  flow = IEATools::iea_cols$flow,
  product = IEATools::iea_cols$product,
  e_dot = IEATools::iea_cols$e_dot,
  aggregate_country_name = "World"
)

Arguments

.tidy_iea_df

The .tidy_iea_df from which the Multi-Regional R matrix needs to be created.

V_matrix

The name of the V matrix. Default is IEATools::psut_cols$V.

balancing_matrix

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

matnames

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

imports

The name of the Imports flows in the .tidy_iea_df. Default is IEATools::interface_industries$imports.

country, flow, product, e_dot

See IEATools::iea_cols.

aggregate_country_name

The name of the new region that gathers all flows of the .tidy_iea_df. Default is "World".

Value

A .tidy_iea_df representing the Multi-Regional Supply (V) matrix, with all flows specified by country.

Details

The specification process is to modify both the flow and the product produced so that the producing country is added as prefix using brackets first. Note: matrix names need to be added, most likely using the IEATools::add_psut_matnames, prior to using the function.

Examples

tidy_AB_data %>%
 IEATools::add_psut_matnames() %>%
 specify_MR_V() %>%
 print()
#> # A tibble: 18 × 12
#>    Country Method Energy.type Last.stage  Year Ledger.side
#>    <chr>   <chr>  <chr>       <chr>      <dbl> <chr>      
#>  1 World   PCM    E           Final       2018 Supply     
#>  2 World   PCM    E           Final       2018 Supply     
#>  3 World   PCM    E           Final       2018 Supply     
#>  4 World   PCM    E           Final       2018 Supply     
#>  5 World   PCM    E           Final       2018 Supply     
#>  6 World   PCM    E           Final       2018 Supply     
#>  7 World   PCM    E           Final       2018 Supply     
#>  8 World   PCM    E           Final       2018 Supply     
#>  9 World   PCM    E           Final       2018 Supply     
#> 10 World   PCM    E           Final       2018 Supply     
#> 11 World   PCM    E           Final       2018 Supply     
#> 12 World   PCM    E           Final       2018 Supply     
#> 13 World   PCM    E           Final       2018 Supply     
#> 14 World   PCM    E           Final       2018 Supply     
#> 15 World   PCM    E           Final       2018 Supply     
#> 16 World   PCM    E           Final       2018 Supply     
#> 17 World   PCM    E           Final       2018 Supply     
#> 18 World   PCM    E           Final       2018 Supply     
#> # ℹ 6 more variables: Flow.aggregation.point <chr>, Flow <chr>, Product <chr>,
#> #   Unit <chr>, E.dot <dbl>, matnames <chr>