How to count the grouped observations and then put into a new column with R? I heave this ------------| year name | ------------| 2001 dave | 2001 mag | 2002 pipe | 2003 goody |
Want to turn into this ---------------------| year number_of_years| ---------------------| 2001 2 | 2002 1 | 2003 1 |