Add a procr_table to an Excel sheet using the openxlsx2 package
Source: R/export_excel_layout.R
wb_add_procr_table.RdThis function takes a workbook object and a procr_table, and adds it to a
specified sheet at a specified cell location. It also provides options to
customize the appearance of the table with grid lines and an optional
end-of-table message.
Arguments
- wb
The workbook object where the table will be added.
- tab
The
procr_tableto be added to the workbook.- cell
The cell address where the top-left corner of the table will be placed. Default is "A1".
- sheet
The sheet number or name where the table will be added. Default is
Table1.- grid_lines
Should the worksheet grid lines be shown (
TRUE) or hidden (FALSE, the default)?- endoftable_msg
An optional message to be displayed after the table. Default is NULL.
- footnote_fmt
A function to format footnotes. Default formats footnotes as superscript. The function must accept an integer and return a openxlsx2::fmt_txt object. Example functions include:
function(i) openxlsx2::fmt_txt(paste0("(", i, ")"))function(i) paste0("[", i, "]")function(i) openxlsx2::fmt_txt(paste0("(", i, ")"), vert_align = "superscript", size = 12)function(i) openxlsx2::fmt_txt(paste0(i, ")"), vert_align = "superscript", size = 10)