This function specified the Multi-Regional Resources matrix. Only flows that belong to the Multi-Regional Resources matrix are returned, other flows are filtered out.

specify_MR_R(
  .tidy_iea_df,
  R_matrix = IEATools::psut_cols$R,
  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,
  aggregate_country_name = "World"
)

Arguments

.tidy_iea_df

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

R_matrix

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

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

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 Resources 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_R() %>%
 print()
#> # A tibble: 7 × 12
#>   Country Method Energy.type Last.stage  Year Ledger.side Flow.aggregation.point
#>   <chr>   <chr>  <chr>       <chr>      <dbl> <chr>       <chr>                 
#> 1 World   PCM    E           Final       2018 Supply      Total primary energy …
#> 2 World   PCM    E           Final       2018 Supply      Total primary energy …
#> 3 World   PCM    E           Final       2018 Supply      Total primary energy …
#> 4 World   PCM    E           Final       2018 Supply      Total primary energy …
#> 5 World   PCM    E           Final       2018 Supply      Total primary energy …
#> 6 World   PCM    E           Final       2018 Supply      Total primary energy …
#> 7 World   PCM    E           Final       2018 Supply      Total primary energy …
#> # ℹ 5 more variables: Flow <chr>, Product <chr>, Unit <chr>, E.dot <dbl>,
#> #   matnames <chr>