This is best illustrated by an example:
Input:
1 2 2 1 1 1 2 3 3
Conclusion:
1; 2 2; 1 1 1; 2; 3 3
βββ¬ββββ¬ββββββ¬ββ¬ββββ
β1β2 2 β1 1 1β2β3 3β
βββ΄ββββ΄ββββββ΄ββ΄ββββ
So I'm looking for something like Key /., but Key will group everything together, all two together, and so on. I want to group only adjacent runs together.
One final thought: the key can be used successfully if I can first create one xfor it that looks like this:
0 1 1 2 2 2 3 4 4 NB. x suitable for use in Key
1 2 2 1 1 1 2 3 3 NB. original data
I canβt think of a tacit solution to generate such an x, though (my ideas include a mutating temporary variable to hold the current βlabelβ, that is, numbers from 0 to 4 in xas defined above)
Jonah source
share