[datatable-help] Order of DT after non-keyed by

Joseph Voelkel jgvcqa at rit.edu
Wed Apr 11 01:51:28 CEST 2012


Here is a simple example of a simple question:

dt<-data.table(a=rep(1:5,1:5),b=1,c=rep(1:3,5))
dt
dt[,seq_along(b),by=a] # expected behavior (note: dt is already in order of a)
setkey(dt,c) # to sort by c
dt
dt[,seq_along(b),by=a] # expected behavior? Appears to be in order of unique(dt$a)

Thanks,

Joe Voelkel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20120410/5639b281/attachment.html>


More information about the datatable-help mailing list