This function specifies flows belonging to the Y, U_feed, U_eiou, and B (only for those flows akin to final demand) matrices, according to the Global Market Assumption. See details for more explanations.

specify_MR_Y_U_gma(
  .tidy_iea_df,
  flow = IEATools::iea_cols$flow,
  product = IEATools::iea_cols$product,
  year = IEATools::iea_cols$year,
  method = IEATools::iea_cols$method,
  energy_type = IEATools::iea_cols$energy_type,
  last_stage = IEATools::iea_cols$last_stage,
  e_dot = IEATools::iea_cols$e_dot,
  unit = IEATools::iea_cols$unit,
  country = IEATools::iea_cols$country,
  aggregate_country_name = "World",
  origin = "Origin",
  domestic = "Domestic",
  imported = "Imported",
  provenience = "Provenience",
  Share_Exports_By_Product = "Share_Exports_By_Product",
  Share_Global_Production_By_Product = "Share_Global_Production_By_Product",
  Producing_Country = "Producing_Country"
)

Arguments

.tidy_iea_df

The .tidy_iea_df from which the Multi-Regional Y and U matrices needs to be created.

flow, product, method, year, energy_type, last_stage, e_dot, unit, country

See IEATools::iea_cols.

aggregate_country_name

The name of the new aggregate region for which the Multi-Regional tables are created. Default is "World".

origin

The name of the temporary column specifying whether a given flow is of domestic or imported origin. Default is "Origin.

domestic

The string that indicates that the product is of domestic origin in the new origin column. Default is "Domestic".

imported

The string that indicates that the product is of imported origin in the new origin column. Default is "Imported".

provenience

The name of a temporary column that provides the provenience of each imported flow, according to the Global Market Assumption. Default is "Provenience".

Share_Exports_By_Product

The name of the temporary column containing the share of exports for each product, by country. Default is "Share_Exports_By_Product".

Share_Global_Production_By_Product

The name of the temporary column containing the share of global production for each product, by country. Default is "Share_Global_Production_By_Product".

Producing_Country

The name of the temporary column containing the country of origin of a given flow, i.e. the exporting country. Default is "Producing_Country".

Value

A .tidy_iea_df with flows corresponding to the Y, U_feed, U_eiou, and B matrices are specified.

Details

First, each flow is separated into a flow of domestic product and imported product, using the specify_imported_products() function. Then, the calc_share_exports_by_product() function is used to calculate the share of global exports, for each product, by country. These shares is used to specify the importations of each country, for each product, hence the assumption of a global market.

Only flows belonging to the Y, U_feed, U_eiou, and B matrices are returned. Note that matrices names need to be added first, most likely using the IEATools::add_psut_matnames() function.

Examples

tidy_AB_data %>%
IEATools::add_psut_matnames() %>%
specify_MR_Y_U_gma() %>%
print()
#> # A tibble: 76 × 12
#>    Country Method Energy.type Last.stage  Year Ledger.side
#>    <chr>   <chr>  <chr>       <chr>      <dbl> <chr>      
#>  1 World   PCM    E           Final       2018 Consumption
#>  2 World   PCM    E           Final       2018 Consumption
#>  3 World   PCM    E           Final       2018 Consumption
#>  4 World   PCM    E           Final       2018 Consumption
#>  5 World   PCM    E           Final       2018 Consumption
#>  6 World   PCM    E           Final       2018 Consumption
#>  7 World   PCM    E           Final       2018 Consumption
#>  8 World   PCM    E           Final       2018 Consumption
#>  9 World   PCM    E           Final       2018 Consumption
#> 10 World   PCM    E           Final       2018 Consumption
#> # ℹ 66 more rows
#> # ℹ 6 more variables: Flow.aggregation.point <chr>, Flow <chr>, Product <chr>,
#> #   Unit <chr>, matnames <chr>, E.dot <dbl>