write_custom_xlsx: Write Custom Excel

Description Usage Arguments Value Examples

View source: R/write_custom_excel.R

Description

A Wrapper around openxlsx::write.xlsx

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
write_custom_xlsx(
  x,
  file,
  asTable = F,
  borders = "columns",
  keepNA = F,
  colWidths = 8.43,
  freeze_firstRow = F,
  freeze_firstCol = F,
  head_text = "bold",
  head_fgfill = "#d9ead3",
  head_border = "TopBottomLeftRight",
  head_halign = "center",
  head_valign = "center",
  return_wb = F,
  ...
)

Arguments

x

Object or a list of objects that can be handled by openxlsx::writeData to write to file

file

xlsx file name

asTable

Write using writeDataTable as opposed to writeData

borders

Cell borders, Either "surrounding", "columns" or "rows" or NULL. If "surrounding", a border is drawn around the data. If "rows", a surrounding border is drawn a border around each row. If "columns", a surrounding border is drawn with a border between each column. If "all" all cell borders are drawn

keepNA

If TRUE, NA values are converted to #N/A (or na.string, if not NULL) in Excel, else NA cells will be empty. Defaults to FALSE.

colWidths

May be a single value for all columns (or "auto"), or a list of vectors that will be recycled for each sheet

freeze_firstRow

If TRUE, freezes the first row (equivalent to firstActiveRow = 2)

freeze_firstCol

If TRUE, freezes the first column (equivalent to firstActiveCol = 2)

head_text

Header text styling - one of "bold", "strikeout", "italic", "underline", "underline2" (passed to openxlsx::createStyle)

head_fgfill

Header cell foreground fill colour. (passed to openxlsx::createStyle)

head_border

Header Cell border. A vector of "top", "bottom", "left", "right" or a single string). (passed to openxlsx::createStyle)

head_halign

Header Horizontal alignment of cell contents (passed to openxlsx::createStyle)

head_valign

Header Vertical alignment of cell contents (passed to openxlsx::createStyle)

return_wb

If TRUE Return workbook object.

...

to openxlsx::write.xlsx

Value

Input Data x or workbook object

Examples

1
# write_custom_xlsx(list(a = iris, b = mtcars), "path/to/file.xlsx")

Lightbridge-AI/lbr documentation built on Dec. 27, 2021, 8:09 p.m.