Hello everyone, I'm not sure how best to phrase my question, so I'll just show the input and desired output: The input has the first observation of each class marked with a 1 in the "Set" column. The sorting of the data is obviously very important here, as I've essentially binned the observations according to a particular behaviour that we were observing, which is marked by the 1. I want for all observations until the next instance of a 1 to be in the same class. Set 1 0 0 1 0 0 0 1 1 0 0 The desired output is as follows: Set Class 1 1 0 1 0 1 1 2 0 2 0 2 0 2 1 3 1 4 0 4 0 4 Any help is much appreciated. Cheers, Sean
... View more