View source: R/save_table_to_Excel.R
save_table_to_Excel | R Documentation |
Please be aware that this does overwrite existing data.
save_table_to_Excel(
table,
save_table,
output_tab_name = "Sheet1",
overwrite = "yes",
freeze_top_row = TRUE,
center_top_row = TRUE,
wrap_text = TRUE,
column_widths = NA,
highlight_cells = NA,
bold_cells = NA
)
table |
the table (the data.frame or tibble, really) that you want to save |
save_table |
file name for saving your table. This does not work
if you have included a "." anywhere in your file name except in front of
the file extension. Good: |
output_tab_name |
name of the tab to save your table to; defaults to "Sheet1". |
overwrite |
Should we overwrite if your Excel file already exists and has a tab of the same name that you're trying to save? Options are "yes" (default) to always overwrite, "no" to never overwrite, or "ask", which means that we will ask you whether to overwrite and give you a chance to supply a different file name. |
freeze_top_row |
TRUE (default) or FALSE for whether to freeze the view in Excel so that the top row will always be visible |
center_top_row |
TRUE (default) or FALSE for whether to center the text in the top row |
wrap_text |
TRUE (default) or FALSE for whether to wrap text |
column_widths |
optionally specify a numeric vector for the column
widths. If left as NA, we will guess at reasonable column widths. If you
specify anything, though, you'll need to specify ALL of the column widths.
We'll repeat whatever number or numbers you use until we have enough for
all the columns in your data, so if you want all your columns to be, e.g.,
20 units wide in whatever units it is that Excel uses, just specify
|
highlight_cells |
a named list of cells to highlight where the names are the colors to use for highlighting and the values are the cells to highlight. Default is NA for no highlighting. There are two possible ways to specify which cells to highlight:
|
bold_cells |
a list of cells to make bold. Default is NA for nothing but the first row being bold (which it will be automatically). There are two possible ways to specify which cells to make bold:
|
does not return a new object; only saves an existing object to Excel
save_table_to_Excel(table = starwars,
save_table = "starwars characters.xlsx")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.