- data
A data.frame, vector or factor. If a data.frame is provided, the target variable x must be specified.
Matrices are not supported; please extract a column or convert to a vector or tibble before use.
- x
A dataframe variable.
- weights
A numeric vector of weights. Must be the same length as x.
- digits
Numeric. Number of digits to be displayed for percentages. Default is 1. For N, 2 digits are displayed if there is a weight variable with non-integer weights or if rescale_weight = T, otherwise 0.
- cum
Logical. If FALSE (the default), do not display cumulative percentages. If TRUE, display cumulative percentages.
- total
Logical. If TRUE (the default), add a final row of totals. If FALSE, remove a final row of totals.
- exclude
Values to exclude (e.g., NA, "Other"). Default is NULL.
- sort
Sorting method for values:
"" (default): No specific sorting.
"+": Sort by increasing frequency.
"-": Sort by decreasing frequency.
"name+": Sort alphabetically (A-Z).
"name-": Sort alphabetically (Z-A).
- valid
Logical. If TRUE (the default), display valid percentages (excluding missing values). If FALSE, do not display valid percentages.
- na_val
Character or numeric. For factors, character or numeric vectors, values to be treated as NA.
- rescale_weights
Logical. If FALSE (the default), do not rescale weights. If TRUE, the total count will be the same as the unweighted x.
- info
Logical. If TRUE (the default), print a title and a note (label and class of x, variable weight, dataframe name) information about the model (model formula, number of observations, residual standard deviation and more).
- labelled_levels
For labelled variables, controls how values are displayed using labelled::to_factor(levels = "prefixed"):
"prefixed" or "p" (default): Show labels as [value] label
"labels" or "l": Show only the label
"values" or "v": Show only the underlying value
- styled
Logical. If TRUE (default), formats the output using print.spicy(),
which aligns columns dynamically in a structured three-line table. If FALSE, returns a standard data.frame
without formatting.
- show_empty_levels
Logical. If FALSE (default), factor levels with N = 0 are removed from the output. Set to TRUE to retain all levels, even those with no observations.
- ...
Additional arguments passed to print.spicy(), such as show_all = TRUE