R/MaxRunLength.R

Defines functions MaxRunLength

Documented in MaxRunLength

MaxRunLength <- function(x) {
     runlengths <- rle(x)
     RunLengths <- runlengths$lengths[runlengths$values==0]
     return(max(RunLengths))
}

Try the MiscMath package in your browser

Any scripts or data that you put into this service are public.

MiscMath documentation built on April 13, 2025, 9:07 a.m.