writeExcel | R Documentation |
writeExcel
produces publication-quality Excel reports:
Toplines (one-way frequency tables) or Banners (cross tabulations)
writeExcel( data_summary, filename = getName(data_summary), wb = NULL, theme = themeDefaultExcel(), title = getName(data_summary), subtitle = NULL, table_of_contents = FALSE, n_or_percent = c("percents", "counts"), hypothesis_test = FALSE, logging = FALSE, save_workbook = TRUE )
data_summary |
An object of class |
filename |
character. The name of the output file. |
wb |
An openxlsx Workbook object to add to. Useful for custom front pages. |
theme |
An object of class |
title |
character. An optional title. Defaults to the title provided in the summary. |
subtitle |
character. An optional subtitle. Defaults to an empty string. |
table_of_contents |
logical. Should a list of tables be included at the start
of the report. Defaults to |
n_or_percent |
character vector. Should the data be returned as counts or percents? Valid values are 'counts', 'percents' or both. |
hypothesis_test |
logical. Should hypothesis testing be shown in the tabs?
** Not yet implemented. Defaults to |
logging |
logical. Should basic information related to the function execution
be printed? Defaults to |
save_workbook |
logical. Should the Workbook be saved to an excel file or returned for the
user to continue editing? Defaults to |
If save_workbook
is set to FALSE
, the openxlsx Workbook object is returned
allowing the user to continue editing it before saving. Otherwise the data is returned as it was
provided.
## Not run: # toplines report toplines_summary <- crosstabs(crunch_dataset, weight = "weight") writeExcel(toplines_summary, "filename") # crosstabs report crosstabs_summary <- crosstabs(crunch_dataset, banner = banner_object) writeExcel(crosstabs_summary, "filename") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.