rleseq: numbers up within repeating elements of a vector

rleseqR Documentation

numbers up within repeating elements of a vector

Description

returns unique id within each unique element of a vector or set of provided vectors and also a running id within each unique element

Usage

rleseq(
  ...,
  clump = TRUE,
  recurs = FALSE,
  na.clump = TRUE,
  na.ignore = FALSE,
  sep = paste0(" ", rand.string(length = 6), " "),
  use.data.table = FALSE
)

Arguments

...

Vector(s) to identify with unique id and a running id within each unique id

clump

a logical specifying if duplicates are to be counted together

recurs

a logical that is meant to only be set by the function when using clump = TRUE

Value

a list of idx and seq

Author(s)

Kevin Hadi


kevinmhadi/khtools documentation built on Feb. 14, 2025, 10:25 a.m.