rle_df: rle_df - create a run-length-encoding data.frame

View source: R/utils_vectors.R

rle_dfR Documentation

rle_df - create a run-length-encoding data.frame

Description

Given an rle this function will return a data.frame 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

rle_df(x)

Arguments

x

(vector) An object for which to run an rle

Value

(data.frame)

with length, values, start and end indices.

See Also

Other vectors: len_unique(), names_values_switch(), rle_groups(), rle_seq(), sort_by_names(), true_names(), unify_vec_preserve_order(), unique_with_names(), vlookup(), vlookup_from_ref(), zchar_remove()

Examples

rle_df(sample(c(TRUE,FALSE), replace = TRUE, 100))

yogat3ch/UU documentation built on May 31, 2024, 10:14 p.m.