View source: R/transform_helpers.R
calc_share_global_production_by_product | R Documentation |
This function calculates for each product the share of global production by country.
calc_share_global_production_by_product(
.tidy_iea_df,
country = IEATools::iea_cols$country,
year = IEATools::iea_cols$year,
method = IEATools::iea_cols$method,
energy_type = IEATools::iea_cols$energy_type,
last_stage = IEATools::iea_cols$last_stage,
ledger_side = IEATools::iea_cols$ledger_side,
flow_aggregation_point = IEATools::iea_cols$flow_aggregation_point,
flow = IEATools::iea_cols$flow,
product = IEATools::iea_cols$product,
e_dot = IEATools::iea_cols$e_dot,
unit = IEATools::iea_cols$unit,
matnames = IEATools::mat_meta_cols$matnames,
National_Production_By_Product = "National_Production_By_Product",
Global_Production_By_Product = "Global_Production_By_Product",
Share_Global_Production_By_Product = "Share_Global_Production_By_Product",
Producing_Country = "Producing_Country"
)
.tidy_iea_df |
The |
country, year, method, energy_type, last_stage, ledger_side, flow_aggregation_point, flow, product, e_dot, unit |
See |
matnames |
The column name for matrices names.
Default is |
National_Production_By_Product |
The name of a temporary column that contains the national production by product. |
Global_Production_By_Product |
The name of a temporary column that contains the global production by product. |
Share_Global_Production_By_Product |
The name of the column containing the share of global production. |
Producing_Country |
The name of the column containing the name of the producing country. |
The calculation is done using sequentially the functions:
calc_global_production_by_product()
;
calc_national_production_by_product()
;
and then calculating shares.
Note: the function needs to have a column indicating matrix names added first, most likely using the IEATools::add_psut_matnames()
function.
A data frame representing the share of global production for each product, by country.
tidy_AB_data %>%
IEATools::add_psut_matnames() %>%
calc_share_global_production_by_product() %>%
print()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.