Skip to contents

This function reads the files in eat_fin_paths and creates a data frame of important efficiency and other variables.

Usage

read_all_eta_files(
  eta_fin_paths,
  efficiency_tab_name = PFUWorkflow::machine_constants$efficiency_tab_name,
  year = IEATools::iea_cols$year,
  .values = IEATools::template_cols$.values
)

Arguments

eta_fin_paths

A list of the file paths to machine excel files containing FIN_ETA front sheets, and therefore usable data. Created by calling the get_eta_filepaths() function.

efficiency_tab_name

See PFUWorkflow::machine_constants.

year

See IEATools::iea_cols.

.values

See IEATools::template_cols.

Value

A data frame containing all Eta.fu and Phi.u values present in all Machine excel files, with the following column names: "Country", "Energy.type", "Last.stage", "Method", "Machine", "Eu.product", "Quantity", "Year", "Value".

Details

Note that eta_fin_paths should typically be a list of file paths, each a character string. But eta_fin_paths can be a single character string (not a list), in which case it will be interpreted as a directory containing files that have Eta.fu and Phi.u values. When eta_fin_paths is a single character string (not a list), the directory will be interrogated for files, a list of file paths constructed, and all files read. get_eta_filepaths() is called internally before reading the files and creating the data frames.

Examples

read_all_eta_files(eta_fin_paths = sample_machine_workbook_path())
#> # A tibble: 108 × 9
#>    Country Energy.type Last.stage Method Machine       Eu.product Quantity  Year
#>    <chr>   <chr>       <chr>      <chr>  <chr>         <chr>      <chr>    <dbl>
#>  1 GBR     E           Final      PCM    Industrial e… MD         eta.fu    1960
#>  2 GBR     E           Final      PCM    Industrial e… MD         eta.fu    1961
#>  3 GBR     E           Final      PCM    Industrial e… MD         eta.fu    1962
#>  4 GBR     E           Final      PCM    Industrial e… MD         eta.fu    1963
#>  5 GBR     E           Final      PCM    Industrial e… MD         eta.fu    1964
#>  6 GBR     E           Final      PCM    Industrial e… MD         eta.fu    1965
#>  7 GBR     E           Final      PCM    Industrial e… MD         eta.fu    1966
#>  8 GBR     E           Final      PCM    Industrial e… MD         eta.fu    1967
#>  9 GBR     E           Final      PCM    Industrial e… MD         eta.fu    1968
#> 10 GBR     E           Final      PCM    Industrial e… MD         eta.fu    1969
#> # … with 98 more rows, and 1 more variable: .values <dbl>