I have the following situation:
| V1 | V2 |
|---|---|
| A | A1 |
| A | A1 |
| A | A1 |
| A | A2 |
| A | A2 |
| A | A3 |
| B | B1 |
| B | B2 |
| B | B2 |
and i need to group by V1, and summarise counting how many distinct groups each V1 level has in V2. Something like this:
| V1 | n |
|---|---|
| A | 3 |
| B | 2 |
How can i use dplyr funcitons to solve that?
Thanks!!