write_list_to_Excel: Writes a list to a worksheet in an Excel workbook.

Description Usage Arguments Value Examples

View source: R/write_list_to_Excel.R

Description

Writes a list to a worksheet in an Excel workbook.

Usage

1
write_list_to_Excel(sheet_name, my_list, wb)

Arguments

sheet_name

A string indicating the name of the worksheet.

my_list

A named list with vectors (can have varying sizes).

wb

An openxlsx workbook object containing all current worksheets.

Value

The workbook with the new sheet added. Does not have to be reassigned to wb in main.

Examples

1
2
3
4
wb <- openxlsx::createWorkbook() # Create a workbook
my_list <- list(a=1:3, b=5:12)
write_list_to_Excel("Sheet2", my_list, wb)
openxlsx::saveWorkbook(wb, file="filename.xlsx") # Save wb to file

kazeera/kazutils documentation built on March 7, 2021, 10:59 p.m.