freq_tab function

Generate a tidy n-way frequency table

Generate a tidy n-way frequency table

freq_tab(df, ...)

Arguments

  • df: tibble or data frame (implicit within pipline)
  • ...: grouping, as with group_by()

Returns

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

mtcars %>% freq_tab(vs, gear, carb)

Author(s)

Kieran Healy

  • Maintainer: Kieran Healy
  • License: MIT + file LICENSE
  • Last published: 2020-06-10