convert_fuel_gasoline_into_motor_gasoline: Converts jet fuel type gasoline into motor gasoline

View source: R/cleans.R

convert_fuel_gasoline_into_motor_gasolineR Documentation

Converts jet fuel type gasoline into motor gasoline

Description

This function converts flows of the "Gasoline type jet fuel" product into flows of "Motor gasoline excl. biofuels". The function then gathers those flows into a single new flow. Basically, it aggregates those two products and keeps the "Motor gasoline excl. biofuels" product name.

Usage

convert_fuel_gasoline_into_motor_gasoline(
  .tidy_iea_df,
  product = IEATools::iea_cols$product,
  flow = IEATools::iea_cols$flow,
  e_dot = IEATools::iea_cols$e_dot
)

Arguments

.tidy_iea_df

The .tidy_iea_df for which jet fuel type gasoline needs to be converted into motor gasoline.

product, e_dot, flow

See IEATools::iea_cols.

Value

A .tidy_iea_df for which jet fuel type gasoline is converted into motor gasoline.

Examples

# Here we add a flow of "Gasoline type jet fuel":
tidy_AB_data %>%
tibble::add_row(
 Country = "A",
 Method = "PCM",
 Energy.type = "E",
 Last.stage = "Final",
 Year = 2018,
 Product = "Gasoline type jet fuel",
 Ledger.side = "Consumption",
 Flow.aggregation.point = "Industry",
 Flow = "Iron and steel",
 Unit = "ktoe",
 E.dot = 20
) %>%
 dplyr::filter(Country == "A" & stringr::str_detect(Product, "(G|g)asoline")) %>%
 print()
# Then we gather both flows:
tidy_AB_data %>%
tibble::add_row(
 Country = "A",
 Method = "PCM",
 Energy.type = "E",
 Last.stage = "Final",
 Year = 2018,
 Product = "Gasoline type jet fuel",
 Ledger.side = "Consumption",
 Flow.aggregation.point = "Industry",
 Flow = "Iron and steel",
 Unit = "ktoe",
 E.dot = 20
) %>%
 dplyr::filter(Country == "A" & stringr::str_detect(Product, "(G|g)asoline")) %>%
 convert_fuel_gasoline_into_motor_gasoline() %>%
 print()

earamendia/ECCTools documentation built on May 12, 2023, 2:12 a.m.