[R] rank() not doing really what I want

Henri-Paul Indiogine hindiogine at gmail.com
Fri Oct 12 10:07:07 CEST 2012


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!

Henri-Paul



-- 
Henri-Paul Indiogine

Curriculum & Instruction
Texas A&M University
TutorFind Learning Centre
http://www.tutorfind.ca

Email: hindiogine at gmail.com
Skype: hindiogine




More information about the R-help mailing list