I have a df with 900k rows and each row has an action (about 80 different actions in total) and a number (about 500 different numbers in total), so it looks something like this:
Action Number
a 1
b 3
a 7
b 3
b 1
How can I create a new df using R which creates a new row with the number, the action and the number of rows with that combination, so it looks something like this:
Number Action Total
1 a 1
1 b 1
3 b 2
7 a 1