I would like to add a column to a data frame where the values in the column are based upon the entry order for a specific factor in another column. So specifically for my data I would like to have a "1" for the first visit to a point, a "2" for the second visit, a "3" for the third etc. However, some points have repetitive visits for a given date and should share the same visit number.
The data frame is pre-sorted and looks something like this:
Transect Point Date
1 BEN 1 5/7/12
2 BEN 1 5/10/12
3 BEN 1 5/10/12
4 BEN 2 5/8/12
5 BEN 2 5/11/12
6 BEN 2 5/13/12
I would like to get something like this:
Transect Point Date Vist
1 BEN 1 5/7/12 1
2 BEN 1 5/10/12 2
3 BEN 1 5/10/12 2
4 BEN 2 5/8/12 1
5 BEN 2 5/11/12 2
6 BEN 2 5/13/12 3