primary_aggregates: Total primary aggregate energy from IEA tables

View source: R/aggregates.R

primary_aggregatesR Documentation

Total primary aggregate energy from IEA tables

Description

Calculates total aggregate primary energy from a data frame of IEA data. This function works similar to dplyr::summarise(): it distills .ieadata to many fewer rows according to the grouping variables country, method, energy_type, last_stage, and year, and, possibly, additional grouping variables in the input (.ieadata). .ieadata is grouped by those variables internally. Any grouping variables present in .ieadata are retained for calculating primary aggregate energy. Grouping is removed before output.

Usage

primary_aggregates(
  .ieadata,
  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,
  flow_aggregation_point = IEATools::iea_cols$flow_aggregation_point,
  e_dot = IEATools::iea_cols$e_dot,
  total_primary_energy_supply = IEATools::aggregation_flows$total_primary_energy_supply,
  ex_p = IEATools::aggregate_cols$aggregate_primary
)

Arguments

.ieadata

The data frame containing IEA data.

country, method, energy_type, last_stage, year, flow_aggregation_point, e_dot

See IEATools::iea_cols.

total_primary_energy_supply

See IEATools::aggregation_flows.

ex_p

See IEATools::aggregate_cols.

Value

A data frame containing the country, method, energy_type, last_stage, and year columns of .ieadata and a column named with the value of ex_p.

Examples

load_tidy_iea_df() %>% 
  primary_aggregates()

MatthewHeun/IEATools documentation built on Feb. 6, 2024, 3:29 p.m.