cross: Group by the interaction of two variables

Description Usage Arguments

Description

cross creates an mg_groups object that groups a data frame by the interaction of two variables. Each row will be assigned to the group that corresponds with the unique combination of var1 and var2 values found in that row. var1 and var2 should be variables that appear in the dataframe to be grouped.

Usage

1
  cross(var1, var2, drop = TRUE)

Arguments

var1

the name of a variable to group on written as a character string

var2

the name of a variable to group on written as a character string

drop

logical should group names ignore the existence of var1 and var2 combinations that do not appear in the data frame


garrettgman/modelglyphs documentation built on May 16, 2019, 5:39 p.m.