write_df_to_Excel: Writes a data frame to a worksheet in an Excel workbook.

Description Usage Arguments Value Examples

View source: R/write_df_to_Excel.R

Description

Writes a data frame to a worksheet in an Excel workbook.

Usage

1
write_df_to_Excel(sheet_name, my_df, wb, incl_rownames = F)

Arguments

sheet_name

A string indicating the name of the worksheet.

my_df

A data frame.

wb

An openxlsx workbook object containing all current worksheets.

incl_rownames

Logical indicating whether rownames of the input data frame should be printed, default F.

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_df <- DNase
write_df_to_Excel("Sheet1", my_df, wb)
openxlsx::saveWorkbook(wb, file="filename.xlsx") # Save wb to file

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