<div>
                    Aha, the issue seems to be with 'uniqlist', not sure why it gives 
                </div><div><blockquote type="cite">(f__ = data.table:::uniqlist(byval, order=o__)) # 1,3</blockquote><div>1,2,3 for you and 1,3 consistently for me. I'll revert this back to `duplist` for now. Not sure how to solve this though. I've tried it so far on 3 machines:</div></div><div><br></div><div>1) OS X 10.8.5 + libvm (gcc)</div><div>2) OS X Mavericks + Clang </div><div>3) Debian Weezy + gcc</div><div><br></div><div>All of them give consistent output. Man this is such a drag.</div><div><br></div><div><div>Arun</div><div><br></div></div>
                 
                <p style="color: #A0A0A8;">On Thursday, December 19, 2013 at 8:37 AM, Kevin Ushey wrote:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div><div>Hi Arun,</div><div><br></div><div>Here's the output on my machine -- other information missing from</div><div>before; it's with OSX Mavericks, with R and data.table compiled with</div><div>Apple clang.</div><div><br></div><div>---</div><div><br></div><blockquote type="cite"><div><div>library(data.table, lib="/Users/kevinushey/Library/R/3.1/library")</div><div>set.seed(32)</div><div>n <- 3</div><div>dt <- data.table(</div></div></blockquote><div>+   y=rnorm(n),</div><div>+   by=round( rnorm(n), 1)</div><div>+ )</div><blockquote type="cite"><div></div></blockquote><div>## run one</div><blockquote type="cite"><div><div>byval <- list(by=dt$by)</div><div>(o__ <- data.table:::fastorder(byval)) # 2,3,1</div></div></blockquote><div>[1] 2 3 1</div><blockquote type="cite"><div>(f__ = data.table:::uniqlist(byval, order=o__)) # 1,3</div></blockquote><div>[1] 1 2 3</div><blockquote type="cite"><div>(len__ = data.table:::uniqlengths(f__, nrow(dt))) # 2,1</div></blockquote><div>[1] 1 1 1</div><blockquote type="cite"><div>(firstofeachgroup = o__[f__]) # 2,1</div></blockquote><div>[1] 2 3 1</div><blockquote type="cite"><div>(origorder = data.table:::iradixorder(firstofeachgroup)) # 2,1</div></blockquote><div>[1] 3 1 2</div><blockquote type="cite"><div>(f__ = f__[origorder]) # 3,1</div></blockquote><div>[1] 3 1 2</div><blockquote type="cite"><div>(len__ = len__[origorder]) # 2,1</div></blockquote><div>[1] 1 1 1</div><div><br></div><div>## run two</div><blockquote type="cite"><div>(o__ <- data.table:::fastorder(byval)) # 2,3,1</div></blockquote><div>[1] 1 2 3</div><blockquote type="cite"><div>(f__ = data.table:::uniqlist(byval, order=o__)) # 1,3</div></blockquote><div>[1] 1 3</div><blockquote type="cite"><div>(len__ = data.table:::uniqlengths(f__, nrow(dt))) # 2,1</div></blockquote><div>[1] 2 1</div><blockquote type="cite"><div>(firstofeachgroup = o__[f__]) # 2,1</div></blockquote><div>[1] 1 3</div><blockquote type="cite"><div>(origorder = data.table:::iradixorder(firstofeachgroup)) # 2,1</div></blockquote><div>[1] 1 2</div><blockquote type="cite"><div>(f__ = f__[origorder]) # 3,1</div></blockquote><div>[1] 1 3</div><blockquote type="cite"><div>(len__ = len__[origorder]) # 2,1</div></blockquote><div>[1] 2 1</div><div><br></div><div>On Wed, Dec 18, 2013 at 11:22 PM, Arunkumar Srinivasan</div><div><<a href="mailto:aragorn168b@gmail.com">aragorn168b@gmail.com</a>> wrote:</div><blockquote type="cite"><div><div>Not sure how to debug without being able to reproduce. Tried on Mac OS X</div><div>10.8.5 and Debian GNU/Linux 7 (wheezy). I don't have access to a windows</div><div>machine. I consistently gives me this:</div><div><br></div><blockquote type="cite"><div>dt[,</div></blockquote><div>+    list(max=max(y, na.rm=TRUE)),</div><div>+    by=list(by)</div><div>+    ]</div><div>    by        max</div><div>1: 0.7 0.01464054</div><div>2: 0.4 0.87328871</div><blockquote type="cite"><div><div><br></div><div>dt[,</div></div></blockquote><div>+    list(max=max(y, na.rm=TRUE)),</div><div>+    by=list(by)</div><div>+    ]</div><div>    by        max</div><div>1: 0.7 0.01464054</div><div>2: 0.4 0.87328871</div><div><br></div><div>Can either of you provide me with the output of these steps in cases where</div><div>there's an error? I've commented the output I get for each step.</div><div><br></div><div>byval <- list(by=dt$by)</div><div>o__ <- data.table:::fastorder(byval) # 2,3,1</div><div>f__ = data.table:::uniqlist(byval, order=o__) # 1,3</div><div>len__ = data.table:::uniqlengths(f__, nrow(dt)) # 2,1</div><div>firstofeachgroup = o__[f__] # 2,1</div><div>origorder = data.table:::iradixorder(firstofeachgroup) # 2,1</div><div>f__ = f__[origorder] # 3,1</div><div>len__ = len__[origorder] # 2,1</div><div><br></div><div><br></div><div>Arun</div><div><br></div><div><...snip...></div></div></blockquote></div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>