Let say, for instance, I have this data frame:
id name date
1 Susan 1/1/2020
2 jhon 1/1/2020
3 Susan 1/1/2020
4 eric 2/4/2020
5 eric 2/4/2020
6 Susan 2/1/2020
7 eric 2/4/2020
And I need the following:
id name date output
1 Susan 1/1/2020 1
2 jhon 1/8/2020 1
3 Susan 1/1/2020 2
4 eric 2/4/2020 1
5 eric 2/4/2020 2
6 Susan 2/9/2019 1
7 eric 2/4/2020 3