calc_bilateral_trade_df_gma: Calculates bilateral trade data frame associated with Global...

View source: R/transforms_to_gma.R

calc_bilateral_trade_df_gmaR Documentation

Calculates bilateral trade data frame associated with Global Market Assumption

Description

The function calculates the bilateral trade data associated to a .tidy_iea_df, using the Global Market Assumption.

Usage

calc_bilateral_trade_df_gma(
  .tidy_iea_df,
  year = IEATools::iea_cols$year,
  method = IEATools::iea_cols$method,
  energy_type = IEATools::iea_cols$energy_type,
  last_stage = IEATools::iea_cols$last_stage,
  country = IEATools::iea_cols$country,
  provenience = "Provenience",
  matnames = "matnames",
  Share_Exports_By_Product = "Share_Exports_By_Product"
)

Arguments

.tidy_iea_df

The .tidy_iea_df for which the associated bilateral trade data, using the Global Market Assumption, needs to be calculated.

year, method, energy_type, last_stage

See IEATools::iea_cols.

country

The name of the column in the output data frame that receives the flow, i.e. the importing country for a given flow. Default is IEATools::iea_cols$country.

provenience

The name of the column in the output data frame that originates the flow, i.e. the exporting country for a given flow. Default is "Provenience".

matnames

The column name for matrices names. Default is IEATools::mat_meta_cols$matnames.

Share_Exports_By_Product

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

Details

A column specifying matrix name for each flows needs to be added before, most likely using the IEATools::add_psut_matnames() function.

Value

A data frame that represents the bilateral trade data associated to the input .tidy_iea_df, using the Global Market Assumption.

Examples

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

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