Skip to contents

Create an RLE Grouping from a logical vector

Usage

rle_groups(x)

Arguments

x

lgl vector

Value

list

Examples

rle_groups(sample(c(TRUE, FALSE), 20, replace = TRUE))
#> [[1]]
#> [1] 2 3 4 5
#> 
#> [[2]]
#> [1] 7 8
#> 
#> [[3]]
#> [1] 12 13 14 15 16
#> 
#> [[4]]
#> [1] 18 19 20
#>