Write a single data frame into one sheet of a Workbook. file can be a wbWorkbook object or a file path string. When a file path is given, the workbook is loaded (or created if the file does not exist), the sheet is written, and the file is saved back automatically.

Write a list of data frames into a Workbook, one sheet per element. file can be a wbWorkbook object or a file path string. When a file path is given, the workbook is loaded (or created if absent), written, and saved back automatically. The file extension is normalised to .xlsx.

write_sheet(d, file, sheetName, overwrite = FALSE)

write_sheets(lst, file, .progress = "none", show = FALSE, overwrite_wb = TRUE)

write_list2xlsx(
  lst,
  file,
  .progress = "none",
  show = FALSE,
  overwrite_wb = TRUE
)

Arguments

d

A data frame.

file

A file path string or an existing wbWorkbook object.

sheetName

Sheet name string.

overwrite

if TRUE and sheetName already exists, replace it.

lst

List of data frames. Names are used as sheet names.

.progress

name of the progress bar to use, see create_progress_bar.

show

open the file after saving (only applies when file is a path).

overwrite_wb

if TRUE (default) always create a fresh workbook when file is a path, even if the file already exists. Set to FALSE to load and append to an existing file.

Value

The (modified) wbWorkbook object, invisibly.

The (modified) wbWorkbook object, invisibly.