specify_MR_R: Specifies Multi-Regional R matrix

View source: R/transforms_to_gma.R

specify_MR_RR Documentation

Specifies Multi-Regional R matrix

Description

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.

Usage

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".

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.

Value

A .tidy_iea_df representing the Multi-Regional Resources matrix, with all flows specified by country.

Examples

tidy_AB_data %>%
 IEATools::add_psut_matnames() %>%
 specify_MR_R() %>%
 print()

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