Fast way of splitting data table by value of an column
<p>I have a big data table object like the following:</p>

<pre><code>&gt; head(trade_hist,12)
        timestamp   price takeFrom volume
 1: 1448905691000 2440.21      ask  0.346
 2: 1448905691000 2440.11      bid  0.016
 3: 1448905691000 2439.78      ask  0.019
 4: 1448905691000 2440.16      ask  0.470
 5: 1448905691000 2439.59      bid  0.029
 6: 1448905691000 2440.16      bid  0.006
 7: 1448905691000 2439.75      ask  0.045
 8: 1448905691000 2440.12      ask  0.042
 9: 1448905691000 2439.62      bid  0.168
10: 1448905692000 2439.49      ask  0.016
11: 1448905692000 2439.46      ask  0.013
12: 1448905692000 2439.43      bid  0.394
</code></pre>

<p>and I intend to split it into a list of data tables by timestamp. I can do:</p>

<pre><code>&gt; trade_hist_list &lt;- split(trade_hist,f=trade_hist$timestamp)
&gt; trade_hist_list[[1]]
       timestamp   price takeFrom volume
1: 1448905691000 2440.21      ask  0.346
2: 1448905691000 2440.11      bid  0.016
3: 1448905691000 2439.78      ask  0.019
4: 1448905691000 2440.16      ask  0.470
5: 1448905691000 2439.59      bid  0.029
6: 1448905691000 2440.16      bid  0.006
7: 1448905691000 2439.75      ask  0.045
8: 1448905691000 2440.12      ask  0.042
9: 1448905691000 2439.62      bid  0.168
</code></pre>

<p>However this process is really slow, since the timestamp is sorted it should be a lot faster. Any suggestions? thx!</p>