Skip to contents

Adds rows for biomass from resources.

Usage

specify_primary_production(
  .df,
  product = MWTools::mw_cols$product,
  primary = MWTools::all_stages$primary,
  stage = MWTools::mw_constants$stage_col,
  notation = RCLabels::from_notation,
  resources = MWTools::mw_sectors$resources_sector
)

Arguments

.df

A muscle work data frame with products already specified, usually by specify_product().

product

See MWTools::mw_constants.

primary

See MWTools::all_stages.

stage

See MWTools::mw_constants.

notation

The notation to be used for primary energy product specification. Default is RCLabels::from_notation.

resources

See MWTools::mw_sectors.

Value

A data frame with primary production specified.

Details

If no primary rows are found (probably because .df has no rows), .df is returned unmodified.

Examples

hmw_df <- hmw_test_data_path() %>%
  read.csv() %>%
  calc_hmw_pfu()
amw_df <- amw_test_data_path() %>%
  read.csv() %>%
  calc_amw_pfu()
specify_energy_type_method(hmw_df, amw_df) %>%
  specify_product() %>%
  MWTools::specify_primary_production()
#> # A tibble: 4,392 × 10
#>    Country  Year Species       Stage Sector Unit    E.dot Energ…¹ Method Product
#>    <chr>   <dbl> <chr>         <chr> <chr>  <chr>   <dbl> <chr>   <chr>  <chr>  
#>  1 GBR      1960 Human females Final Agric… EJ    8.68e-4 E       PCM    Food   
#>  2 GBR      1960 Human females Final Indus… EJ    1.54e-2 E       PCM    Food   
#>  3 GBR      1960 Human females Final Servi… EJ    2.82e-2 E       PCM    Food   
#>  4 GBR      1960 Human females Prim… Agric… EJ    1.40e-3 E       PCM    Biomass
#>  5 GBR      1960 Human females Prim… Indus… EJ    2.48e-2 E       PCM    Biomass
#>  6 GBR      1960 Human females Prim… Servi… EJ    4.55e-2 E       PCM    Biomass
#>  7 GBR      1960 Human females Usef… Agric… EJ    4.64e-5 E       PCM    HuMech 
#>  8 GBR      1960 Human females Usef… Indus… EJ    7.44e-4 E       PCM    HuMech 
#>  9 GBR      1960 Human females Usef… Servi… EJ    4.64e-4 E       PCM    HuMech 
#> 10 GBR      1960 Human males   Final Agric… EJ    4.64e-3 E       PCM    Food   
#> # … with 4,382 more rows, and abbreviated variable name ¹​Energy.type