The function calculates total imports by product, for each country, for each year.

calc_imports_by_product(
  .tidy_iea_df,
  flow = IEATools::iea_cols$flow,
  e_dot = IEATools::iea_cols$e_dot,
  imports = IEATools::interface_industries$imports
)

Arguments

.tidy_iea_df

The .tidy_iea_df for which total imports need to be calculated.

flow, e_dot

See IEATools::iea_cols.

imports

The name of the column containing the quantity (in energy terms) of imported products. Default is IEATools::interface_industries$imports.

Value

A data frame returning the value of imported energy by product, for each country and year.

Examples

tidy_AB_data %>%
calc_imports_by_product() %>%
print()
#> # A tibble: 4 × 11
#>   Country Method Energy.type Last.stage  Year Ledger.side Flow.aggregation.point
#>   <chr>   <chr>  <chr>       <chr>      <dbl> <chr>       <chr>                 
#> 1 A       PCM    E           Final       2018 Supply      Total primary energy …
#> 2 B       PCM    E           Final       2018 Supply      Total primary energy …
#> 3 B       PCM    E           Final       2018 Supply      Total primary energy …
#> 4 B       PCM    E           Final       2018 Supply      Total primary energy …
#> # ℹ 4 more variables: Flow <chr>, Product <chr>, Unit <chr>, Imports <dbl>