get_longest_run: Length of the longest run of TRUEs

View source: R/cms.R

get_longest_runR Documentation

Length of the longest run of TRUEs

Description

Identifies the length of the longest run of TRUEs in Boolean vector x. used to be maxCMS

Usage

get_longest_run(x)

Arguments

x

Boolean vector

Value

an integer value of the length of the longest run of TRUE values

Examples

x <- rbinom(100, size = 1, prob = 1 / 3)
get_runs(x == 1) # expected value for longest match is 3
get_longest_run(x == 1)

heike/bulletxtrctr documentation built on March 8, 2024, 7:41 p.m.