df_to_xlsx | R Documentation |
This function adds a data.frame to an excel file, formatting the header. Also allows to select columns where rows with equal values are merged.
df_to_xlsx(
excel_file,
sheet_names,
dfs,
auto_size_cols = TRUE,
merge_cols = NULL,
nested_merge = TRUE
)
excel_file |
Location of excel file where data.frame will be added |
auto_size_cols |
Should column width be changed based on their contents? TRUE or FALSE, defaults to TRUE |
merge_cols |
Names of columns that should be merged vertically when they have the same value. Default is no merging, expects a character vector. Currently only works if you pass a single df |
nested_merge |
Should merging be done with columns on the right being nested inside the ones on the left? TRUE or FALSE |
sheet_name |
Names of the sheet inside the file -will replace sheets with same name- |
df |
List of data.frame to be added to file |
Excel file with data.frame added
df_to_xlsx(excel_file = "./excel.xlsx", sheet_name = "information", df = info_df, merge_cols = c("Continent", "Country"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.