Skip to contents

This function wraps `openxlsx::writeData`, but deletes all current content before writing new data.

Usage

xlsxWriteData(wb, sheetName, dt)

Arguments

wb

A workbook object created by `openxlsx::loadWorkbook()`.

sheetName

A character string specifying the name of the sheet where data will be written.

dt

A `data.table` to write.

Value

An invisible NULL value. The function performs an action (adding data to a sheet)

See also

Other function to read from and write to xlsx: setHeadersToLowerCase(), splitInputs(), xlsxAddDataUsingTemplate(), xlsxAddSheet(), xlsxCloneAndSet(), xlsxReadData()

Examples

if (FALSE) { # \dontrun{
wb <- loadWorkbook("example.xlsx")
data <- data.table(Name = c("Charlie", "Dana"), Age = c(28, 32))
xlsxWriteData(wb, "ExistingSheet", data)
} # }