export_excel_tabs: Splits dataframe into Excel sheets by column

View source: R/export_excel_tabs.R

export_excel_tabsR Documentation

Splits dataframe into Excel sheets by column

Description

Takes one dataframe and exports it as multiple Excel sheets in the same file, with table formatting, headers, auto-column width, etc., based on the categories in a column. Currently does not auto-size columns with dates correctly. This function can be used first, and then ExportExcel(), with the "existing" argument, used second in order to add a separate sheet.

Usage

export_excel_tabs(df, tab_name, file_name, drop_col = TRUE, col_width = "auto")

Arguments

df

A data frame, will be exported as an Excel table

tab_name

a string, the name of the column which should be used to separate the df into tabs

file_name

a string, the name of the file to be created

drop_col

optional (defaults to TRUE) logical, if FALSE then the column specified in the tab_name argument remains is not dropped

col_width

optional (defaults to 'auto'), either 'auto' for autosized columns or a vector of numbers which must be equal to the number of columns

Value

A new .xlsx file with records from a single dataframe placed on multiple tabs

Author(s)

Jeremy Pesner, Lillian Nguyen

See Also

export_excel

Examples

export_excel_tabs(iris, "Species", "iris.xlsx")


baltimorebudget/bbmR documentation built on Aug. 28, 2023, 6:32 p.m.