streak: Functions to determine and group streaks/consecutive events.

View source: R/streak.R

streakR Documentation

Functions to determine and group streaks/consecutive events.

Description

Streaks are also known as run lengths.

Usage

streak(event, only_true = TRUE)

streak_max(event)

streak_group(streak_max)

Arguments

event

A logical vector indicating if an event occurred or not.

only_true

Should only events that are TRUE be returned as streaks?

streak_max

In the case of streak_group, the output from the streak_max function.

Value

Integer vector with the length of event or streak_max.

Author(s)

Stuart K. Grange

See Also

rle


skgrange/threadr documentation built on May 11, 2024, 12:16 p.m.