Skip to contents

Relative frequencies in data when grouping by more than one variable.

Usage

rel_freq_data(data, grouping_vars, rel_freq_vars, sort_n_desc = FALSE)

Arguments

data

Input data frame.

grouping_vars

A character vector containing grouping variables of a data table.

rel_freq_vars

A character vector containing grouping variables of a data table that have to be part of argument grouping_vars.

sort_n_desc

A boolean value indicating whether the whole data frame should be sorted in descending order by n. Default is FALSE.

Value

A (grouped) data frame.