write_ecc_to_excel | R Documentation |
It is often helpful to see energy conversion chain (ECC) matrices in Excel format, arranged spatially. This function takes ECC matrices and writes them to an Excel file.
write_ecc_to_excel(
.psut_data = NULL,
path,
overwrite_file = FALSE,
pad = 2,
include_io_mats = FALSE,
R = Recca::psut_cols$R,
U = Recca::psut_cols$U,
V = Recca::psut_cols$V,
Y = Recca::psut_cols$Y,
r_eiou = Recca::psut_cols$r_eiou,
U_eiou = Recca::psut_cols$U_eiou,
U_feed = Recca::psut_cols$U_feed,
S_units = Recca::psut_cols$S_units,
.wrote_mats_colname = "Wrote mats",
UV_bg_color = "#FDF2D0",
RY_bg_color = "#D3712D",
calculated_bg_color = "#D9D9D9",
col_widths = 7
)
.psut_data |
A list or data frame of energy conversion chains. |
path |
The path of the Excel file to be created. |
overwrite_file |
A boolean that tells whether you want to overwrite
the file at |
pad |
The number of rows and columns between adjacent matrices in the Excel sheet.
Default is |
include_io_mats |
A boolean that tells whether to include input-output matrices
in the worksheets written by this function.
Input-output matrices are obtained from |
R, U, U_feed, U_eiou, r_eiou, V, Y, S_units |
Names of ECC matrices or actual matrices.
See |
.wrote_mats_colname |
The name of the outgoing column that tells whether a worksheet was written successfully. Default is "Wrote mats". |
UV_bg_color |
The color of cells containing U and V matrices. Default is a creamy yellow. |
RY_bg_color |
The color of cells containing R and Y matrices. Default is a rust color. |
calculated_bg_color |
The color of cells containing calculated matrices. Default is gray. |
col_widths |
The widths of columns of matrices.
Default is |
If .psut_data
is a PSUT data frame,
each row is written to a different tab in the output file at path
.
An unmodified version of .psut_data
(if not NULL
) or a list of
the incoming matrices.
## Not run:
ecc <- UKEnergy2000mats %>%
tidyr::spread(key = "matrix.name", value = "matrix")
ecc_temp_path <- tempfile(pattern = "write_excel_ecc_test_file", fileext = ".xlsx")
write_ecc_to_excel(ecc, path = ecc_temp_path, overwrite = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.