add_sheet.Rd
This function is a wrapper for openxlsx::addWorksheet()
and openxlsx::writeData()
, but also does some extra formatting via more openxlsx functions.
add_sheet(
wb,
data,
sheetName = NULL,
colWidth = "auto",
colWidthMin = 5,
colWidthMax = 25,
gridLines = FALSE,
freezefirstRow = TRUE,
freezefirstCol = FALSE,
addFilters = TRUE,
rowheight = 15,
textwrap = TRUE,
dateformat = "yyyy-mm-dd",
datetimeformat = "yyyy-mm-dd hh:mm:ss"
)
A Workbook object to attach the new worksheet
Object to be written. For classes supported look at the examples in openxlsx.
The name of the worksheet that is to be created and have data
written into. Defaults to the data
object name if left empty.
For all columns: column width. Can either be Excel column width units or "auto" for automatic sizing
For all columns: minimum column width
For all columns: maximum column width
If FALSE
, the worksheet grid lines will be hidden
If TRUE
, freezes the first row
If TRUE
, freezes the first row
If TRUE
, adds filters to worksheet columns
Row height in Excel row height units
If TRUE
, all cells are formatted via text wrap so their content never spills into adjacent empty cells
If not "none"
(default is "yyyy-mm-dd"
), all date-formatted columns in data
are explicitly formatted with numFmt = "yyyy-mm-dd"
If not "none"
(default is "yyyy-mm-dd hh:mm:ss"
), all datetime-formatted columns in data
are explicitly formatted with numFmt = "yyyy-mm-dd hh:mm:ss"