I have a column (called eventCat) in my data frame of 5 factors (Drought, Dry, Normal, Wet, Storm) e.g.
eventCat
Dry
Dry
Drought
Drought
Wet
Storm
Storm
Normal
Normal
Dry
Dry
I want to provide an ID to each group of events, so that the df looks like this (Note different IDs for the different Dry events):
eventCat eventCatID
Dry 1
Dry 1
Drought 2
Drought 2
Wet 3
Storm 4
Storm 4
Normal 5
Normal 5
Dry 6
Dry 6