count_cat_df: Counts and Proportions for Categorical Variables

Description Usage Arguments Value Warning Examples

Description

This function returns descriptives for categorical variables (reports total counts (n) and percentage of total)

Usage

1

Arguments

df

a data frame object to report descriptives on

...

names of categorical variables to report the descriptives by group

Value

Returns a data frame with total counts by group and percentage of total by group

Warning

If columns with non-continuous values (numeric or integer) exist in df, an error is thrown and returns potential columns that you will have to remove for the function to work.

Examples

1
2
3
iris %>% 
 mutate(Bin = sample(x = 1:3,size = 150,replace = TRUE)) %>% 
 count_cat_df(Species, Bin)

smh-ej/XploreR documentation built on May 13, 2019, 4:46 p.m.