extract_tidy_product_erois: Extracts product level EROIs from tidy Input Output matrices

View source: R/extract_erois.R

extract_tidy_product_eroisR Documentation

Extracts product level EROIs from tidy Input Output matrices

Description

The function extracts product level EROIs from tidy Input Output matrices, in a tidy format.

Usage

extract_tidy_product_erois(
  .tidy_io_mats,
  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,
  matnames = IEATools::mat_meta_cols$matnames,
  matvals = IEATools::mat_meta_cols$matvals,
  eroi_g_p = "eroi_g_p",
  eroi_n_p = "eroi_n_p",
  eroi_g_p_feed = "eroi_g_p_feed",
  eroi_n_p_feed = "eroi_n_p_feed",
  type = "Type",
  boundary = "Boundary",
  eroi = "EROI",
  product = IEATools::iea_cols$product,
  colnames = "colnames",
  rowtypes = "rowtypes",
  coltypes = "coltypes"
)

Arguments

.tidy_io_mats

The .tidy_io_mats data frame from which EROIs should be extracted.

country, method, energy_type, last_stage, year, product

See IEATools::iea_cols.

matnames

The column name of the column having matrices names. Default is IEATools::mat_meta_cols$matnames.

matvals

The column name of the column reporting matrices values, once expanded. Default is IEATools::mat_meta_cols$matvals.

eroi_g_p

The name of the column containing vectors of product-level gross EROIs, including both energy use for feedstock and EIOU production. Default is "eroi_g_p".

eroi_n_p

The name of the column containing vectors of product-level net EROIs, including both energy use for feedstock and EIOU production. Default is "eroi_n_p".

eroi_g_p_feed

The name of the column containing vectors of product-level gross EROIs, including only energy use for feedstock production. Default is "eroi_g_p_feed".

eroi_n_p_feed

The name of the column containing vectors of product-level net EROIs, including only energy use for feedstock production. Default is "eroi_g_p_feed".

type

The name of the EROI type column (i.e. gross or net EROI). Default is "Type".

boundary

The name of the boundary column. Default is "Boundary".

eroi

The name of the product EROI column in output. Default is "EROI".

colnames

The name of columns when expanding matrices. Default is "colnames".

rowtypes

The name of row types when expanding matrices. Default is "rowtypes".

coltypes

The name of column types when expanding matrices. Default is "coltypes".

Details

The function can be called after calculating EROIs through the Recca::calc_erois() function. The type column indicates whether the calculated EROI is gross or net. The boundary column indicates whether the EROI includes:

  • Only energy use for feedstock production ("Feedstock");

  • Both energy use for feedstock production and for EIOU production ("All").

Value

A data frame reporting calculated EROIs in a tidy format.

Examples

# Let's first have a look at the raw data obtained when calculating EROIs:
calculated_erois_raw <- ECCTools::tidy_AB_data %>%
 IEATools::prep_psut() %>%
 Recca::calc_io_mats() %>%
 Recca::calc_E_EIOU() %>%
 Recca::calc_erois() %>%
 dplyr::glimpse()
# Let's then extract EROIs in a tidy format:
calculated_erois_raw %>%
 extract_tidy_product_erois() %>%
 print()

earamendia/EROITools documentation built on May 19, 2023, 10:30 a.m.