View source: R/export_excel_tabs.R
export_excel_tabs | R Documentation |
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.
export_excel_tabs(df, tab_name, file_name, drop_col = TRUE, col_width = "auto")
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 |
A new .xlsx file with records from a single dataframe placed on multiple tabs
Jeremy Pesner, Lillian Nguyen
export_excel
export_excel_tabs(iris, "Species", "iris.xlsx")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.