maxConsecutive.Rd
Maximum number of consecutive values in a vector
maxConsecutive(vec, val = TRUE, gte = NA)
a vector
the value to search for consecutive values
return indices for values greater than or equal to this number of consecutive values (default= NA, which is only the max). Note that if gte > the max, the index returned will be NA
the number of consecutive values. 0 means that value is not present in the vector
maxConsecutive(c(1,2,7,5,7,7,7,3,4),val = 7)
#> $max
#> [1] 3
#>
#> $index
#> [1] 5 6 7
#>