`rleidv()` not behaving as advertised #1942

Closed
JoshOBrien opened this Issue Nov 30, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@JoshOBrien
Contributor

JoshOBrien commented Nov 30, 2016

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.

@mattdowle mattdowle added this to the v1.10.0 milestone Dec 1, 2016

@mattdowle mattdowle closed this in 131ec03 Dec 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment