get_runs: Table of the number of runs

View source: R/cms.R

get_runsR Documentation

Table of the number of runs

Description

Identify the length of runs (of values TRUE) and their frequencies.

Usage

get_runs(x)

Arguments

x

Boolean vector

Value

a table of the number of runs of TRUEs

Examples

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

heike/bulletxtrctr documentation built on June 3, 2024, 12:08 a.m.