title: First element in a data.table aggregation
body: <p>I have a <code>data.table</code> of tick data, which I want to aggregate into seconds timeframe. While getting <code>max</code>, <code>min</code> and <code>last</code> is pretty straightforward:</p>
  
  <pre><code>data[, list(max(value), min(value), last(value)), by=time]
  </code></pre>
  
  <p>I am struggling to get the <em>first datapoint</em> which corresponds to a certain second timestamp. There is nothing in the manual. Is there an easy way to do it, like say, SQL <code>TOP</code>?</p>