Counts and percentages across grouping variables.
cat_counter(data, x, y = NULL, ...)
A dataframe (or a tibble) from which variables specified are to be taken. A matrix or tables will not be accepted.
The variable to use as the rows in the contingency table.
The variable to use as the columns in the contingency
table. Default is NULL
. If NULL
, one-sample proportion test (a goodness
of fit test) will be run for the x
variable. Otherwise an appropriate
association test will be run. This argument can not be NULL
for
ggbarstats
function.
Additional grouping variables.
# NOT RUN {
ggstatsplot:::cat_counter(data = ggplot2::mpg, "drv", cyl, "fl")
# }
Run the code above in your browser using DataLab