View source: R/write_multi_tabbed_xlsx.R
write_multi_tabbed_xlsx | R Documentation |
Wrapper for some steps using openxlsx
package to write multiple to multiple
tabs in an Excel spreadsheet. Apparently, openxlsx::write.xlsx()
will
accomplish the same thing. I just found this out. I use this other method so
regularly that I still feel like saving it here for posterity.
write_multi_tabbed_xlsx(tab_names, list_of_dfs, file_path, over_write = TRUE)
tab_names |
Character vector of names for the tabs in the Excel spreadsheet. |
list_of_dfs |
A list of data frames to write to file. |
file_path |
Path and filename to write to. |
over_write |
Logical. Overwrite the existing file of the same name.
Default is |
A workbook object
## Not run:
dat <- split(mtcars, mtcars$cyl)
dat
write_multi_tabbed_xlsx(tab_names = c("4 cyl", "6 cyl", "8 cyl"),
list_of_dfs = dat,
file_path = "C:/Users/latour/Desktop/cylinders.xlsx",
over_write = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.