Add a product column to a muscle work data frame
specify_product.RdA product column is needed before converting a muscle work data frame
to PSUT matrices. This function adds and populates the product column.
Usage
specify_product(
.df,
product = MWTools::mw_cols$product,
primary = MWTools::all_stages$primary,
final = MWTools::all_stages$final,
useful = MWTools::all_stages$useful,
species = MWTools::mw_constants$species,
human = MWTools::mw_species$human,
stage = MWTools::mw_constants$stage_col,
sector = MWTools::mw_constants$sector_col,
biomass = MWTools::mw_products$biomass,
food = MWTools::mw_products$food,
feed = MWTools::mw_products$feed,
hu_mech = MWTools::mw_products$hu_mech,
an_mech = MWTools::mw_products$an_mech,
an_p = MWTools::mw_products$an_p,
transport = MWTools::mw_sectors$transport_sector
)Arguments
- .df
A data frame, likely produced by
specify_energy_type_method().- product
The name of the column to be added. See
MWTools::mw_constants.- primary, final, useful
See
MWTools::all_stages.- species
- human
See
MWTools::mw_species.- stage, sector
- biomass, food, feed, hu_mech, an_mech, an_p
See
MWTools::mw_products.- transport
See
MWTools::sectors.
Examples
hmw_df <- hmw_test_data_path() %>%
read.csv() %>%
calc_hmw_pfu() %>%
specify_product()
amw_df <- amw_test_data_path() %>%
read.csv() %>%
calc_amw_pfu()
specify_energy_type_method(hmw_df, amw_df) %>%
specify_product()
#> # A tibble: 3,294 × 10
#> Country Year Species Stage Sector Unit E.dot Product Energ…¹ Method
#> <chr> <dbl> <chr> <chr> <chr> <chr> <dbl> <chr> <chr> <chr>
#> 1 GBR 1960 Human females Final Agric… EJ 8.68e-4 Food E PCM
#> 2 GBR 1960 Human females Final Indus… EJ 1.54e-2 Food E PCM
#> 3 GBR 1960 Human females Final Servi… EJ 2.82e-2 Food E PCM
#> 4 GBR 1960 Human females Prim… Agric… EJ 1.40e-3 Biomass E PCM
#> 5 GBR 1960 Human females Prim… Indus… EJ 2.48e-2 Biomass E PCM
#> 6 GBR 1960 Human females Prim… Servi… EJ 4.55e-2 Biomass E PCM
#> 7 GBR 1960 Human females Usef… Agric… EJ 4.64e-5 HuMech E PCM
#> 8 GBR 1960 Human females Usef… Indus… EJ 7.44e-4 HuMech E PCM
#> 9 GBR 1960 Human females Usef… Servi… EJ 4.64e-4 HuMech E PCM
#> 10 GBR 1960 Human males Final Agric… EJ 4.64e-3 Food E PCM
#> # … with 3,284 more rows, and abbreviated variable name ¹Energy.type