Grouping on multiple variables in R
问题 I'm a power excel pivot table user who is forcing himself to learn R. I know exactly how to do this analysis in excel, but can't figure out the right way to code this in R. I'm trying to group user data by 2 different variables, while grouping the variables into ranges (or bins), then summarizing other variables. Here is what the data looks like: userid visits posts revenue 1 25 0 25 2 2 2 0 3 86 7 8 4 128 24 94 5 30 5 18 … … … … 280000 80 10 100 280001 42 4 25 280002 31 8 17 Here is what I