Prepares tidy iea data frame with Global Market Assumption for shares calculations
prepare_gma_for_shares.Rd
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.
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.
Examples
ECCTools::tidy_AB_data %>%
IEATools::add_psut_matnames() %>%
ECCTools::transform_to_gma() %>%
prepare_gma_for_shares()
#> # A tibble: 101 × 13
#> Country Method Energy.type Last.stage Year Ledger.side
#> <chr> <chr> <chr> <chr> <dbl> <chr>
#> 1 A PCM E Final 2018 Supply
#> 2 A PCM E Final 2018 Supply
#> 3 A PCM E Final 2018 Supply
#> 4 A PCM E Final 2018 Supply
#> 5 B PCM E Final 2018 Supply
#> 6 B PCM E Final 2018 Supply
#> 7 B PCM E Final 2018 Supply
#> 8 A PCM E Final 2018 Supply
#> 9 A PCM E Final 2018 Supply
#> 10 A PCM E Final 2018 Supply
#> # ℹ 91 more rows
#> # ℹ 7 more variables: Flow.aggregation.point <chr>, Flow <chr>, Product <chr>,
#> # Unit <chr>, E.dot <dbl>, matnames <chr>, product_without_origin <chr>