Cumulative sum for positive numbers only

前端 未结 9 1197
梦谈多话
梦谈多话 2020-12-09 08:13

I have this vector :

x = c(1,1,1,1,1,0,1,0,0,0,1,1)

And I want to do a cumulative sum for the positive numbers only. I should have the fol

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