Dear All,
    For any given vector, I want to extract a sub-vector such that the new vector skips all zeros, if any , at the start of vector. Is it possible to achieve this w/o looping?

    E.G :     >    x    = c(0,0,1,2,3,4,5,0,0,8,9)
                 >    y    = somefunc(x);
                > y 
                [1]    1 2 3 4 5 0 0 8 9

    In the example above, I want to skip the two leading zeroes till I hit the non-zero (1 in the above case). I also want to retain all zero after the first non-zero digit (again 1 in this case).

    Hope I am not confusing you guys. Thanks in advance for your help.

Regards

Manoj

        

    
	[[alternative HTML version deleted]]


