Dear Data Table Help List,
I am using data.table version 1.6 (with R version 2.12.2, 64-bit on Windows 7).
Suppose I have a table whose key does not give me a unique ordering. Then the
output of the "roll" option will be arbitrary (i.e., it will depend on what one
does between the two executions). Is this something noteworthy?
Please see output of the following:
> DT = data.table(A=c(1,2,2),B=c("b1","b3","b2"),key="A")
> DT[J(1:3),roll=TRUE] # output 1
A B
[1,] 1 b1
[2,] 2 b3
[3,] 2 b2
[4,] 3 b2
> key(DT)="B" # change keys to do other stuff...
> key(DT)="A" # get back to key A
> DT[J(1:3),roll=TRUE] # output 2 does not match output 1
A B
[1,] 1 b1
[2,] 2 b2
[3,] 2 b3
[4,] 3 b3
(Also, as an aside, I get identical output in the two executions of
DT[J(1:3),roll=TRUE] when I start with the table DT =
data.table(A=c(1,2,2),B=c("b1","b2","b3"),key="A") instead.)
I'm sure there must also be other reverberations-beyond the effect on the roll
option.
Any insight would be of interest. Thank you.
-Alex
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help