specify_energy_type_method: Add energy type and method columns to tidy muscle work data...

View source: R/specify.R

specify_energy_type_methodR Documentation

Add energy type and method columns to tidy muscle work data frames

Description

To specify muscle work data in preparation for conversion to PSUT matrices, the first step is specifying that these data are energy (not exergy) data and indicating the method for estimating the primary energy ("Biomass [from Resources]") associated with the initial stage of final energy ("Biomass"). We assume the Physical Content Method (PCM) in which the primary energy ("Biomass [from Resources]") is equal in magnitude to the final energy ("Biomass").

Usage

specify_energy_type_method(
  .hmw_df,
  .amw_df,
  e_dot = MWTools::mw_cols$e_dot,
  energy_type = MWTools::mw_cols$energy_type,
  method = MWTools::mw_cols$method,
  e_type = MWTools::energy_types$e,
  pcm = MWTools::methods$pcm
)

Arguments

.hmw_df

A data frame produced by calc_hmw_pfu().

.amw_df

A data frame produced by calc_amw_pfu().

e_dot, energy_type, method, e_type

See MWTools::mw_cols.

pcm

See MWTools::methods.

Details

.hmw_df and .amw_df bound by rows. The resulting data frame is modified, replacing any NA values with 0 in the e_dot column.

Value

A data frame in which energy_type and method columns are included.

Examples

ilo_working_hours_data <- read.csv(file = MWTools::ilo_working_hours_test_data_path())
ilo_employment_data <- read.csv(file = MWTools::ilo_employment_test_data_path())
hmw_data <- prepareRawILOData(ilo_working_hours_data = ilo_working_hours_data,
                              ilo_employment_data = ilo_employment_data)
hmw_df <- hmw_data %>%
  calc_hmw_pfu()
amw_df <- amw_test_data_path() %>%
  read.csv() %>%
  calc_amw_pfu()
specify_energy_type_method(hmw_df, amw_df)

EnergyEconomyDecoupling/MWTools documentation built on April 14, 2025, 9:27 a.m.