Skip to contents

Starting from human and animal muscle work data frames, this function bundles several functions to create a data frame of PSUT matrices. The bundled functions are:

Usage

prep_psut(
  .hmw_df,
  .amw_df,
  unit = IEATools::iea_cols$unit,
  R = IEATools::psut_cols$R,
  U = IEATools::psut_cols$U,
  V = IEATools::psut_cols$V,
  Y = IEATools::psut_cols$Y,
  s_units = IEATools::psut_cols$s_units,
  U_feed = IEATools::psut_cols$U_feed,
  U_eiou = IEATools::psut_cols$U_eiou,
  r_eiou = IEATools::psut_cols$r_eiou
)

Arguments

.hmw_df

A data frame produced by calc_hmw_pfu().

.amw_df

A data frame produced by calc_amw_pfu().

unit, R, U, V, Y, s_units, U_feed, U_eiou, r_eiou

Column names. See IEATools::psut_cols.

Value

A data frame of musle work PSUT matrices.

Details

Default values are assumed for function arguments.

The "Unit" column is deleted after the "S_units" column is created.

Examples

hmw_df <- hmw_test_data_path() %>%
  read.csv() %>%
  calc_hmw_pfu() %>%
  # Keep only a few years for speed.
  dplyr::filter(Year %in% 2000:2002)
amw_df <- amw_test_data_path() %>%
  read.csv() %>%
  calc_amw_pfu() %>%
  # Keep only a few years for speed.
  dplyr::filter(Year %in% 2000:2002)
prep_psut(hmw_df, amw_df)
#> # A tibble: 12 × 13
#>    Country  Year Method Energy.type Last.s…¹ R        U        V        Y       
#>    <chr>   <dbl> <chr>  <chr>       <chr>    <list>   <list>   <list>   <list>  
#>  1 CHNM     2000 PCM    E           Final    <dbl[…]> <dbl[…]> <dbl[…]> <dbl[…]>
#>  2 CHNM     2000 PCM    E           Useful   <dbl[…]> <dbl[…]> <dbl[…]> <dbl[…]>
#>  3 CHNM     2001 PCM    E           Final    <dbl[…]> <dbl[…]> <dbl[…]> <dbl[…]>
#>  4 CHNM     2001 PCM    E           Useful   <dbl[…]> <dbl[…]> <dbl[…]> <dbl[…]>
#>  5 CHNM     2002 PCM    E           Final    <dbl[…]> <dbl[…]> <dbl[…]> <dbl[…]>
#>  6 CHNM     2002 PCM    E           Useful   <dbl[…]> <dbl[…]> <dbl[…]> <dbl[…]>
#>  7 GBR      2000 PCM    E           Final    <dbl[…]> <dbl[…]> <dbl[…]> <dbl[…]>
#>  8 GBR      2000 PCM    E           Useful   <dbl[…]> <dbl[…]> <dbl[…]> <dbl[…]>
#>  9 GBR      2001 PCM    E           Final    <dbl[…]> <dbl[…]> <dbl[…]> <dbl[…]>
#> 10 GBR      2001 PCM    E           Useful   <dbl[…]> <dbl[…]> <dbl[…]> <dbl[…]>
#> 11 GBR      2002 PCM    E           Final    <dbl[…]> <dbl[…]> <dbl[…]> <dbl[…]>
#> 12 GBR      2002 PCM    E           Useful   <dbl[…]> <dbl[…]> <dbl[…]> <dbl[…]>
#> # … with 4 more variables: S_units <list>, U_feed <list>, U_EIOU <list>,
#> #   r_EIOU <list>, and abbreviated variable name ¹​Last.stage