Skip to contents

This function creates a GT table of the frequencies of a specified variable and has the ability to get the frequencies for one grouping variable. While this can be used on it's own, it was created more to be used in get_all_freqs()`, a function that outputs the frequencies of a set of variables to a word doc.

Usage

get_freq_table(data, x, group, wt, show_genpop = FALSE)

Arguments

data

An object of type data.frame or tibble. If piping the data into the function, this is not required.

x

Either a character string or symbol. The variable with which want to get the frequencies.

group

Either a character string or a symbol. The grouping variable.

wt

Weights. Add if you have a weighting variable and want to get weighted frequencies

show_genpop

Logical. Should there be a column showing the frequencies for the general population