Open tklebel opened 9 years ago
We could make use of group_by
, grouped tibbles and so forth.
Should we allow this?
data %>%
group_by(~ group) %>%
crosstab(dep ~ indep)
Or rather?
data %>%
crosstab(dep ~ indep, group/layer = ~group)
Should we allow several layers of grouping, eg: group_by(var1, var2)
? Would that make sense, would there be a valid use case?
In case not, issue a warning for grouped tibbles with more than one grouping var.
cross_table
should have a separate argumentlayer
, where you can specify a third variable, which you want to control for. This seems easier to remember than to add another variable to the input-formula.