prepare_gma_for_shares: Prepares tidy iea data frame with Global Market Assumption...

View source: R/helpers_shares.R

prepare_gma_for_sharesR Documentation

Prepares tidy iea data frame with Global Market Assumption for shares calculations

Description

This function prepares a tidy iea data frame following the Global Market Assumption for the calculation of shares of product use within each fossil fuel group. To do this, the country of location is removed from each flow, and is relocated in the country column, and a column of product without origin is added to the data frame.

Usage

prepare_gma_for_shares(
  .tidy_iea_df,
  country = IEATools::iea_cols$country,
  flow = IEATools::iea_cols$flow,
  product = IEATools::iea_cols$product,
  product_without_origin = "product_without_origin"
)

Arguments

.tidy_iea_df

The tidy iea data frame with Global Market Assumption that needs to be prepared for shares calculation.

country, flow, product

See IEATools::iea_cols.

product_without_origin

The name of the column containing the product names without the country of production.

Value

A tidy data frame with Global Market Assumption ready for shares calculations.

Examples

ECCTools::tidy_AB_data %>% 
   IEATools::add_psut_matnames() %>% 
   ECCTools::transform_to_gma() %>% 
   prepare_gma_for_shares()

earamendia/EROITools documentation built on May 19, 2023, 10:30 a.m.