rleIndex: rleIndex

Description Usage Arguments Value Examples

View source: R/General.R

Description

Given an rle this function will return a dataframe of starts, ends, and indexes thereof of the run lengths. Credit: https://stackoverflow.com/questions/43875716/find-start-and-end-positions-indices-of-runs-consecutive-values

Usage

1
rleIndex(input_rle)

Arguments

x

(rle) An rle object

Value

(data.frame)

A data.frame with length, values, start and end indices.

Examples

1
2
dat <- data.frame(y = rnorm(15,0,1),x = {rnorm(15,0,1) + rnorm(15,0,.02)})
rleIndex(rle(abs(dat$x) > .5))

yogat3ch/HDA documentation built on Sept. 13, 2019, 8:54 p.m.