Skip to contents

An interface industry is one that moves energy carriers into or out of a country. When flow is any of the interface industries, we need to be more specific. If we don't separate these flows by product, we run into trouble with upstream swims (e.g., all products are produced even if only one is needed) and embodied energy calculations (many types of energy are embodied, even if only one should be). This function adds a suffix "[of Product]" to each of these interface industries.

Usage

specify_interface_industries(
  .tidy_iea_df,
  flow = IEATools::iea_cols$flow,
  int_industries = c(IEATools::interface_industries, IEATools::tpes_flows$resources,
    manufacture = "Manufacture"),
  product = IEATools::iea_cols$product,
  flow_notation = RCLabels::of_notation,
  product_notation = RCLabels::bracket_notation
)

Arguments

.tidy_iea_df

A tidy data frame containing IEA extended energy balance data.

flow

The name of the flow column in .tidy_iea_df. Default is "Flow".

int_industries

A string vector of industries involved in exchanges with other countries, bunkers, or stock changes. Default is c(IEATools::interface_industries, IEATools::tpes_flows$resources, manufacture = "Manufacture").

product

The name of the product column in .tidy_iea_df. Default is "Product".

flow_notation

The notation for the flow column. Default is RCLabels::of_notation.

product_notation

The notation for the product column. Default is RCLabels::bracket_notation, meaning that any type of "X [from Resources]" or "X [to Y]" will be parsed correctly for its prefix.

Value

A modified version of .tidy_iea_df with specified interface industries.

Details

Note that "Production" also needs to be specified, but that is accomplished in the specify_primary_production() and specify_production_to_resources() functions.

Resource flows and manufacture flows are included by default, because they need a place where they are specified, too.

Examples

load_tidy_iea_df() %>% 
  specify_interface_industries()
#> # A tibble: 403 × 11
#>    Country Method EnergyType LastStage  Year LedgerSide FlowAggregationPoint    
#>    <chr>   <chr>  <chr>      <chr>     <dbl> <chr>      <chr>                   
#>  1 GHA     PCM    E          Final      1971 Supply     Total primary energy su…
#>  2 GHA     PCM    E          Final      2000 Supply     Total primary energy su…
#>  3 GHA     PCM    E          Final      1971 Supply     Total primary energy su…
#>  4 GHA     PCM    E          Final      2000 Supply     Total primary energy su…
#>  5 GHA     PCM    E          Final      2000 Supply     TFC compare             
#>  6 GHA     PCM    E          Final      2000 Supply     TFC compare             
#>  7 GHA     PCM    E          Final      1971 Supply     TFC compare             
#>  8 GHA     PCM    E          Final      2000 Supply     TFC compare             
#>  9 GHA     PCM    E          Final      2000 Supply     TFC compare             
#> 10 GHA     PCM    E          Final      2000 Supply     Transformation processes
#> # ℹ 393 more rows
#> # ℹ 4 more variables: Flow <chr>, Product <chr>, Unit <chr>, Edot <dbl>