Description Usage Arguments Examples
Take a cross tabulation produced by reshape2::dcast
and output a formatted openxlsx wb object
1 2 3 4 5 6 7 | auto_crosstab_to_tab(df, auto_number_format = TRUE, top_headers = NULL,
titles = NULL, footers = NULL, indent = TRUE,
left_header_colnames = NULL, vertical_border = TRUE, auto_merge = TRUE,
insert_below_tab = NULL, total_text = NULL, include_header_rows = TRUE,
wb = NULL, ws_name = NULL, number_format_overrides = list(),
fill_non_values_with = list(na = NULL, nan = NULL, inf = NULL, neg_inf =
NULL), allcount_to_level_translate = NULL)
|
df |
A data.frame. The cross tabulation to convert to Excel |
auto_number_format |
Whether to automatically detect number format |
top_headers |
A list. Custom top headers. See |
titles |
The title. A character vector. One element per row of title |
footers |
Table footers. A character vector. One element per row of footer. |
indent |
Automatically detect level of indentation of each row |
left_header_colnames |
The names of the columns that you want to designate as left headers |
vertical_border |
Boolean. Do you want a left border? |
auto_merge |
Boolean. Whether to merge cells in the title and footers to width of body |
insert_below_tab |
A existing tab object. If provided, this table will be written on the same sheet, below the provided tab. |
total_text |
The text that is used for the 'grand total' of a cross tabulation |
include_header_rows |
Boolean - whether to include or omit the header rows |
wb |
A existing openxlsx workbook. If not provided, a new one will be created |
ws_name |
The name of the worksheet you want to write to |
number_format_overrides |
e.g. list("colname1" = "currency1") see auto_style_number_formatting |
fill_non_values_with |
Manually specify a list of strings that will replace non numbers types NA, NaN, Inf and -Inf. e.g. list(na = '*', nan = ”, inf = '-', neg_inf = '–'). Note: NaNs are not treated as NAs. |
allcount_to_level_translate |
Manually specify how to translate summary levels into header formatting |
1 2 | crosstab <- read.csv(system.file("extdata", "example_crosstab.csv", package="xltabr"))
tab <- auto_crosstab_to_tab(crosstab)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.