View source: R/transform_helpers.R
calc_share_exports_by_product | R Documentation |
This function calculates the share of exports for each product, by country.
calc_share_exports_by_product(
.tidy_iea_df,
flow = IEATools::iea_cols$flow,
country = IEATools::iea_cols$country,
method = IEATools::iea_cols$method,
energy_type = IEATools::iea_cols$energy_type,
last_stage = IEATools::iea_cols$last_stage,
year = IEATools::iea_cols$year,
ledger_side = IEATools::iea_cols$ledger_side,
flow_aggregation_point = IEATools::iea_cols$flow_aggregation_point,
product = IEATools::iea_cols$product,
e_dot = IEATools::iea_cols$e_dot,
unit = IEATools::iea_cols$unit,
exports = IEATools::interface_industries$exports,
matnames = "matnames",
provenience = "Provenience",
Global_Exports_By_Product = "Global_Exports_By_Product",
Share_Exports_By_Product = "Share_Exports_By_Product"
)
.tidy_iea_df |
The |
flow, country, method, energy_type, last_stage, year, ledger_side, flow_aggregation_point, product, e_dot, unit |
See |
exports |
The name of exports flows in the |
matnames |
The column name for matrices names.
Default is |
provenience |
The name of the column reporting the country of provenience, i.e. the exporting country. |
Global_Exports_By_Product |
The name of a temporary column that contains global exports by product. |
Share_Exports_By_Product |
The name of the column that contains the share of exports for each product, by country. |
The function calls first the calc_global_exports()
function.
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 that reports the share of exports for each product, by country.
tidy_AB_data %>%
IEATools::add_psut_matnames() %>%
calc_share_exports_by_product() %>%
print()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.