> * Michael Nelson <[email protected]> [2013-04-24 00:41:33 +0000]: > > frame[, .SD[.N], by = id]
I tried --8<---------------cut here---------------start------------->8--- dt <- frame[, .SD[1] ,by=id] --8<---------------cut here---------------end--------------->8--- (I don't care whether I take first or last, see another message). and I got the note --8<---------------cut here---------------start------------->8--- Finding groups (bysameorder=TRUE) ... done in 0.121secs. bysameorder=TRUE and o__ is length 0 Optimization is on but j left unchanged as '.SD[1]' Starting dogroups ... The result of j is a named list. It's very inefficient to create the same names over and over again for each group. When j=list(...), any names are detected, removed and put back after grouping has completed, for efficiency. Using j=transform(), for example, prevents that speedup (consider changing to :=). --8<---------------cut here---------------end--------------->8--- and indeed it runs unbelievably slow (as if I were using data.table) thanks a lot for your detailed reply! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.10 (quantal) X 11.0.11300000 http://www.childpsy.net/ http://ffii.org http://www.memritv.org http://palestinefacts.org http://iris.org.il http://think-israel.org non-smoking section in a restaurant == non-peeing section in a swimming pool _______________________________________________ datatable-help mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
