cumsum1: Cumulative sum of uninterrupted '1'

Description Usage Arguments Details Value Examples

Description

Cumulative sum of uninterrupted '1'

Usage

1

Arguments

x

integer vector to be used

Details

Returns a vector whose elements are the cumulative sums of uninterrupted entries equal to 1 in an integer vector

Value

integer vector

Examples

1
2
3
4
5
6
7
8
 ## Not run: 

 x <- c(0,1,1,1,0,0,1,1,1,0,0)

 cumsum1(x)

 
## End(Not run) 

sumtxt/datatools documentation built on May 30, 2019, 8:38 p.m.