Skip to content
Prev 256902 / 398506 Next

Find number of elements less than some number: Elegant/fast solution needed

On Apr 14, 2011, at 2:34 PM, Kevin Ummel wrote:

            
I started working on a solution to your problem above and then noted the one below.

Here is one approach to the above:
[1] 0 0 0 0 1 2 2 3 3 4
Something like the following might work, if I correctly understand the problem:
[1]  1 NA  2  3 NA NA  4  5 NA  6


HTH,

Marc Schwartz