Learn R Programming

socviz (version 1.2)

freq_tab: Generate a tidy n-way frequency table

Description

Generate a tidy n-way frequency table

Usage

freq_tab(df, ...)

Arguments

df

tibble or data frame (implicit within pipline)

...

grouping, as with group_by()

Value

A tibble with the grouping variables, the N (`n`) per group, and the proportion (`prop`) of each group, calculated with respect to the outermost grouping variable.

Details

Tidyverse, pipeline, and dplyr-friendly frequency tables

Examples

Run this code
# NOT RUN {
mtcars %>% freq_tab(vs, gear, carb)

# }

Run the code above in your browser using DataLab