The Examples section of ?rleid begins with this code block:
DT = data.table(grp=rep(c("A", "B", "C", "A", "B"), c(2,2,3,1,2)), value=1:10)
rleid(DT$grp) # get run-length ids
rleidv(DT, "grp") # same as above
Although the third line says "same as above", here's what I get when I run the second and third lines of code:
> rleid(DT$grp) # get run-length ids
[1] 1 1 2 2 3 3 3 4 5 5
> rleidv(DT, "grp") # same as above
[1] 1 2 3 4 5 6 7 8 9 10
Not sure whether I'm misunderstanding what rleidv() should do, or whether some breaking change has been introduced since this was last visited.
The Examples section of
?rleidbegins with this code block:Although the third line says "same as above", here's what I get when I run the second and third lines of code:
Not sure whether I'm misunderstanding what
rleidv()should do, or whether some breaking change has been introduced since this was last visited.