divide an element of a vector between the number of consecutive 0 wich preceed : I have this data:

20 0 20 40 0 0 0 40 20 0 20 0 20 0 0 60

and I want to get the following output using R:

20 10 10 40 10 10 10 10 20 10 10 10 10 20 20 20 

Any ideas?



