ggstatsplot (version 0.0.12)

cat_counter: Preparing dataframe with counts and percentages for categorical variables.

Description

Preparing dataframe with counts and percentages for categorical variables.

Usage

cat_counter(data, main, condition = NULL, ...)

Arguments

data

A dataframe (or a tibble) from which variables specified are to be taken. A matrix or tables will not be accepted.

main

The variable to use as the rows in the contingency table.

condition

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 main variable. Otherwise an appropriate association test will be run.

...

Additional grouping variables.

Examples

Run this code
# NOT RUN {
ggstatsplot:::cat_counter(data = ggplot2::mpg, "drv", cyl, "fl")
# }

Run the code above in your browser using DataCamp Workspace