How to fill in the preceding numbers whenever there is a 0 in R?

前端 未结 5 1356
小蘑菇
小蘑菇 2021-02-13 18:19

I have a string of numbers:

n1 = c(1, 1, 0, 6, 0, 0, 10, 10, 11, 12, 0, 0, 19, 23, 0, 0)

I need to replace 0 with the corresponding number righ

5条回答
提交回复
热议问题