Write a final-to-useful machine efficiencies template to a file
write_eta_fu_template.Rd
The template should be created by eta_fu_template()
.
Usage
write_eta_fu_template(
.eta_fu_template,
path,
eta_fu_tab_name = IEATools::fu_analysis_file_info$eta_fu_tab_name,
overwrite_file = FALSE,
overwrite_fu_eta_tab = FALSE,
eta_fu = IEATools::template_cols$eta_fu,
e_dot_machine = IEATools::template_cols$e_dot_machine,
e_dot_machine_perc = IEATools::template_cols$e_dot_machine_perc,
maximum_values = IEATools::template_cols$maximum_values,
header_row_font_color = "#FFFFFF",
header_row_shading_color = "#5A80B8",
e_dot_machine_row_font_color = "#8C87A0",
e_dot_machine_row_shading_color = "#E3DFEB",
e_dot_machine_perc_row_font_color = "#8C87A0",
e_dot_machine_perc_row_shading_color = "#E3DFEB",
eta_row_font_color = "#000000",
eta_row_shading_color = "#FFFFFF",
phi_row_font_color = "#000000",
phi_row_shading_color = "#FFFFFF",
blank_shading_color = "#808080",
quantity = IEATools::template_cols$quantity,
e_dot_machine_max_perc = IEATools::template_cols$e_dot_machine_max_perc,
.rownum = ".rownum"
)
Arguments
- .eta_fu_template
a template for final-to-useful energy efficiency values, generated by
eta_fu_template()
.- path
the file path where the eta_fu template will be written
- eta_fu_tab_name
the name of the final-to-useful efficiency tab. Default is "FU etas".
- overwrite_file
a logical telling whether to overwrite a file, if it already exists. Default is
FALSE
.- overwrite_fu_eta_tab
a logical telling whether to overwrite the final-to-useful efficiency tab, if it already exists. Default is
FALSE
.- eta_fu
the name of the final-to-useful efficiency rows in
.eta_fu_template
. Default is IEATools::template_cols$eta_fu.- e_dot_machine
a string identifying energy flow into final-to-useful machines. Default is "Edot_machine".
- e_dot_machine_perc
a string identifying percentage of total final energy flowing into final-to-useful machines. Default is "Edot_machine [%]".
- maximum_values
a string identifying the maximum values column in the outgoing template. Default is
IEATools::template_cols$maximum_values
.- header_row_font_color
a hex string representing the font color for the header row in the Excel file that is written by this function. Default is "#FFFFFF", white.
- header_row_shading_color
a hex string representing the shading color for the header row in the Excel file that is written by this function. Default is "#5A80B8", medium blue.
- e_dot_machine_row_font_color
a hex string representing the font color for rows of energy flows into final-to-useful machines in the Excel file that is written by this function. Default is "#8C87A0", a dark purple color.
- e_dot_machine_row_shading_color
a hex string representing the shading color for rows of energy flows into final-to-useful machines in the Excel file that is written by this function. Default is "#5A80B8", medium purple color.
- e_dot_machine_perc_row_font_color
a hex string representing the font color for rows of percentage of energy flows into final-to-useful machines in the Excel file that is written by this function. Default is "#8C87A0", a dark purple color.
- e_dot_machine_perc_row_shading_color
a hex string representing the shading color for rows of percentage of energy flows into final-to-useful machines in the Excel file that is written by this function. Default is "#5A80B8", medium purple color.
- eta_row_font_color
a hex string representing the font color for
eta_fu
rows in the Excel file that is written by this function. Default is "#000000", black.- eta_row_shading_color
a hex string representing the shading color for
eta_fu
rows in the Excel file that is written by this function. Default is "#FFFFFF", white.- phi_row_font_color
a hex string representing the font color for
phi_u
rows in the Excel file that is written by this function. Default is "#000000", black.- phi_row_shading_color
a hex string representing the shading color for
phi_u
rows in the Excel file that is written by this function. Default is "#FFFFFF", white.- blank_shading_color
a hex string representing the shading color for blank cells in the
maximum_values
column. Default is "#808080".- quantity
the name of the quantity column in
.eta_fu_template
. Default is "Quantity".- e_dot_machine_max_perc
the name of the rows that give maximum percentages. Default is "Edot_machine_max [%]".
- .rownum
the name of a temporary column containing row numbers. Default is ".rownum".
Examples
f <- tempfile(fileext = ".xlsx")
load_fu_allocation_data() %>%
eta_fu_template() %>%
write_eta_fu_template(f)
#> [1] "/tmp/RtmpQQQr1I/file16294e2755cf.xlsx"
if (file.exists(f)) {
file.remove(f)
}
#> [1] TRUE