Suppose I have a dataframe with a variable which has in it data indicating groupings. Let's say a 'level' variable which has in it 1,2, etc. indicating the level of some observations.
I would like to generate a crosstabs table of two other variables based on all groupings of level. I would like to end up with a SINGLE table such that for each level grouping we can see the crosstabs of the two other variables and also an 'overall' section of the table where the level grouping is not applied and so that section of the table shows the cross tabs without any level grouping.
How can I do this in r please?