This function calculates global production by product. Included flows are flows belonging to either the R or V matrices, excluding import flows.

calc_global_production_by_product(
  .tidy_iea_df,
  country = IEATools::iea_cols$country,
  ledger_side = IEATools::iea_cols$ledger_side,
  flow_aggregation_point = IEATools::iea_cols$flow_aggregation_point,
  flow = IEATools::iea_cols$flow,
  e_dot = IEATools::iea_cols$e_dot,
  matnames = IEATools::mat_meta_cols$matnames,
  V_matrix = IEATools::psut_cols$V,
  R_matrix = IEATools::psut_cols$R,
  imports = IEATools::interface_industries$imports,
  Global_Production_By_Product = "Global_Production_By_Product"
)

Arguments

.tidy_iea_df

The .tidy_iea_df for which global production needs to be calculated.

country, ledger_side, flow_aggregation_point, flow, e_dot

See IEATools::iea_cols.

matnames

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

V_matrix

The name of the V matrix. Default is IEATools::psut_cols$V.

R_matrix

The name of the R matrix. Default is IEATools::psut_cols$R.

imports

The name of imports flows in the .tidy_iea_df. Default is IEATools::interface_industries$imports.

Global_Production_By_Product

The name of the new column returning global production by product.

Value

A data frame representing global production by product, for each year.

Details

Note: the function needs to have a column indicating matrix names added first, most likely using the IEATools::add_psut_matnames() function.

Examples

tidy_AB_data %>%
IEATools::add_psut_matnames() %>%
calc_global_production_by_product() %>%
print()
#> # A tibble: 12 × 7
#> # Groups:   Method, Energy.type, Last.stage, Year, Product [12]
#>    Method Energy.type Last.stage  Year Product      Unit  Global_Production_By…¹
#>    <chr>  <chr>       <chr>      <dbl> <chr>        <chr>                  <dbl>
#>  1 PCM    E           Final       2018 Blast furna… ktoe                    1700
#>  2 PCM    E           Final       2018 Coke oven c… ktoe                    1800
#>  3 PCM    E           Final       2018 Coking coal  ktoe                    5000
#>  4 PCM    E           Final       2018 Coking coal… ktoe                    5000
#>  5 PCM    E           Final       2018 Crude oil    ktoe                    8500
#>  6 PCM    E           Final       2018 Crude oil [… ktoe                    8500
#>  7 PCM    E           Final       2018 Electricity  ktoe                    4200
#>  8 PCM    E           Final       2018 Heat         ktoe                     750
#>  9 PCM    E           Final       2018 Kerosene ty… ktoe                    2750
#> 10 PCM    E           Final       2018 Motor gasol… ktoe                    3600
#> 11 PCM    E           Final       2018 Natural gas  ktoe                    4100
#> 12 PCM    E           Final       2018 Natural gas… ktoe                    4000
#> # ℹ abbreviated name: ¹​Global_Production_By_Product