Add energy type and method columns to tidy muscle work data frames
specify_energy_type_method.Rd
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.
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)
#> # A tibble: 3,330 × 9
#> Country Year Species Stage Sector Unit E.dot Energy.type Method
#> <chr> <dbl> <chr> <chr> <chr> <chr> <dbl> <chr> <chr>
#> 1 GBR 1960 Human females Final Agricul… EJ 8.68e-4 E PCM
#> 2 GBR 1960 Human females Final Industry EJ 1.54e-2 E PCM
#> 3 GBR 1960 Human females Final Services EJ 2.82e-2 E PCM
#> 4 GBR 1960 Human females Primary Agricul… EJ 1.40e-3 E PCM
#> 5 GBR 1960 Human females Primary Industry EJ 2.48e-2 E PCM
#> 6 GBR 1960 Human females Primary Services EJ 4.55e-2 E PCM
#> 7 GBR 1960 Human females Useful Agricul… EJ 4.16e-5 E PCM
#> 8 GBR 1960 Human females Useful Industry EJ 7.43e-4 E PCM
#> 9 GBR 1960 Human females Useful Services EJ 4.77e-4 E PCM
#> 10 GBR 1960 Human males Final Agricul… EJ 4.64e-3 E PCM
#> # ℹ 3,320 more rows