rank() not doing really what I want
On Oct 12, 2012, at 1:07 AM, Henri-Paul Indiogine wrote:
Hi Michael! 2012/10/12 R. Michael Weylandt <michael.weylandt at gmail.com>:
If they are already in decreasing order, you might be able to work something out like (untested): cumsum(c(1, diff(x) < 0))
Thanks seems to work. Thanks a bunch!
Another strategy: cumsum(!duplicated(x))
David Winsemius, MD Alameda, CA, USA