title: With data.table, is SD[which.max(Var1)] the fastest way to find the max of a group?
body: <p>If needed I can put together a dataset, but my question is somewhat general.</p>
  
  <pre><code>accts &lt;- accts[, .SD[which.max(EE)], by=DnB.Name]
  </code></pre>
  
  <p>I've got a DT of about 350k rows, and some of the DnB.Name's (Duns and Bradstreet Company Name) are duplicates with differing employee counts (EE), I only care about the highest number of each and can disregard the rest.</p>
  
  <p>Anyway, DT is usually lightning quick, so I figure I must be doing something wrong?</p>