adj.rle: Adjacent Values Run Length Encoding

View source: R/utils.R

adj.rleR Documentation

Adjacent Values Run Length Encoding

Description

Similar to rle function, this function detects "runs" of adjacent integers, and displays vector of run lengths and list of corresponding integer sequences.

Usage

adj.rle(x)

Arguments

x

a numeric vector with

Value

a list with two elements: vector of run lengths, and another list of values corresponding to generated sequences' lengths.

Author(s)

Gabor Grothendieck <ggrothendieck@gmail.com>

References

See original thread for more details https://stackoverflow.com/a/8467446/564164. Special thanks to Gabor Grothendieck for this one!


Rapporter/rapportools documentation built on March 23, 2022, 2:23 a.m.