Skip to contents

Analysts fill final-to-useful (FU) efficiency tables in a human-readable format provided by eta_fu_template() and write_eta_fu_template(). The templates are not tidy. However, most code uses in IEATools requires tidy data frames. This function converts an FU efficiency table with years in columns to a tidy data frame with years in a year column and eta_fu and phi_u values in a .values column. Identifiers for the variables are in the quantity column.

Usage

tidy_eta_fu_table(
  .eta_fu_table,
  year = IEATools::iea_cols$year,
  unit = IEATools::iea_cols$unit,
  e_dot_machine = IEATools::template_cols$e_dot_machine,
  e_dot_machine_perc = IEATools::template_cols$e_dot_machine_perc,
  quantity = IEATools::template_cols$quantity,
  maximum_values = IEATools::template_cols$maximum_values,
  .values = IEATools::template_cols$.values
)

Arguments

.eta_fu_table

The final-to-useful efficiency table to be tidied.

year, unit

See IEATools::iea_cols.

e_dot_machine, e_dot_machine_perc, quantity, maximum_values, .values

See IEATools::template_cols.

Value

A tidy version of .eta_fu_table.

Details

If .eta_fu_table is already tidy, it is returned unmodified.

Examples

load_eta_fu_data() %>% 
  tidy_eta_fu_table()
#> # A tibble: 234 × 9
#>    Country Method EnergyType LastStage Machine    EuProduct Quantity  Year Value
#>    <chr>   <chr>  <chr>      <chr>     <chr>      <chr>     <chr>    <dbl> <dbl>
#>  1 GHA     PCM    E          Final     Automobil… MD        etafu     1971  0.3 
#>  2 GHA     PCM    E          Final     Automobil… MD        etafu     2000  0.31
#>  3 GHA     PCM    E          Final     Automobil… MD        phiu      1971  1   
#>  4 GHA     PCM    E          Final     Automobil… MD        phiu      2000  1   
#>  5 GHA     PCM    E          Final     Diesel ca… MD        etafu     1971  0.3 
#>  6 GHA     PCM    E          Final     Diesel ca… MD        etafu     2000  0.3 
#>  7 GHA     PCM    E          Final     Diesel ca… MD        phiu      1971  1   
#>  8 GHA     PCM    E          Final     Diesel ca… MD        phiu      2000  1   
#>  9 GHA     PCM    E          Final     Diesel tr… MD        etafu     1971  0.3 
#> 10 GHA     PCM    E          Final     Diesel tr… MD        etafu     2000  0.3 
#> # ℹ 224 more rows