- data
A data frame.
- row_vars
Character vector of variable names to place in rows.
- group_var
Single character variable name used for columns/groups.
- labels
Optional character labels for row_vars (same length).
- levels_keep
Optional character vector of levels to keep/order for row
modalities. If NULL, all observed levels are kept.
- include_total
Logical. If TRUE (the default), includes a Total group
when available.
- drop_na
Logical. If TRUE (the default), removes rows with NA in the
row/group variable before each cross-tabulation. If FALSE, missing values
are displayed as a dedicated "(Missing)" level.
- weights
Optional weights. Either NULL (the default), a numeric vector
of length nrow(data), or a single column name in data.
- rescale
Logical. If FALSE (the default), weights are used as-is.
If TRUE, rescales weights so total weighted N matches raw N.
Passed to spicy::cross_tab().
- correct
Logical. If FALSE (the default), no continuity correction is
applied. If TRUE, applies Yates correction in 2x2 chi-squared contexts.
Passed to spicy::cross_tab().
- simulate_p
Logical. If FALSE (the default), uses asymptotic p-values.
If TRUE, uses Monte Carlo simulation. Passed to spicy::cross_tab().
- simulate_B
Integer. Number of Monte Carlo replicates when
simulate_p = TRUE. Defaults to 2000.
- percent_digits
Number of digits for percentages in report outputs.
Defaults to 1.
- p_digits
Number of digits for p-values (except < .001).
Defaults to 3.
- v_digits
Number of digits for the association measure. Defaults
to 2.
- assoc_measure
Passed to cross_tab(). Which association measure
to report ("auto", "cramer_v", "phi", "gamma", "tau_b",
"tau_c", "somers_d", "lambda", "none"). Defaults to "auto".
- assoc_ci
Passed to cross_tab(). If TRUE, includes the
confidence interval. In data/export formats (wide, long, excel,
clipboard), two extra columns CI lower and CI upper are added.
In rendered formats (gt, tinytable, flextable, word), the CI
is shown inline as .14 [.08, .19] in the association measure column.
Defaults to FALSE.
- decimal_mark
Decimal separator ("." or ","). Defaults to ".".
- output
Output format: "wide" (the default), "long",
"tinytable", "gt", "flextable", "excel", "clipboard",
"word".
- style
"auto" (the default) to select by output type, "raw" for
machine-friendly outputs, "report" for formatted outputs.
- indent_text
Prefix used for modality labels in report table building.
Defaults to " " (two spaces).
- indent_text_excel_clipboard
Stronger indentation used in Excel and
clipboard exports. Defaults to six non-breaking spaces.
- add_multilevel_header
Logical. If TRUE (the default), merges top
headers in Excel export.
- blank_na_wide
Logical. If FALSE (the default), NA values are kept
as-is in wide raw output. If TRUE, replaces them with empty strings.
- excel_path
Path for output = "excel". Defaults to NULL.
- excel_sheet
Sheet name for Excel export. Defaults to "APA".
- clipboard_delim
Delimiter for clipboard text export. Defaults to "\t".
- word_path
Path for output = "word" or optional save path when
output = "flextable". Defaults to NULL.