Skip to contents

Merge two grouping var columns into one.

Usage

construct_grouping_var(dat, grouping_vars, group_var = "group")

Arguments

dat

Data frame with a group column.

grouping_vars

Character vector containing maximal two column names in dat that should be used to distinguish between subgroups. If two columns are provided, they will be merged internally into one.

group_var

Name of the group column in your data. Defaults to group.

Value

Data frame with a new grouping_var column, constructed from the provided grouping_vars and the group_var column.

Examples

# tbd