title: Row index for a data.table "binary search" on a subset of columns
body: <p>I have a larger set of data and need the <strong>Row numbers</strong> of rows that fulfill certain conditions. Package data.table.</p>
  
  <pre><code>days &lt;- strptime(c("2013-01-01 8:00:00", "2013-02-01 8:00:00"), format="%Y-%m-%d %H:%M:%S")
  DateTime &lt;- rep(seq(days[1], days[2], length.out=1e6/5), 5)
  Update &lt;- rep(LETTERS[3:1], length.out=1e6)
  Group &lt;- rep(c("AAA", "BBB", "CCC"), length.out=1e6)
  Weight &lt;- trunc(rnorm(1e6, 110, 3))
  Weight2 &lt;- rnorm(1e6, 100, 1.5)
  DT &lt;- data.table(DateTime, Update, Group, Weight, Weight2)
  setkey(DT, DateTime, Update, Group, Weight, Weight2)
  
  Exp &lt;- DT[1e6/2]
  </code></pre>
  
  <p>I cannot create another data.table as a subset without the column DateTime since this column is used in the key. Creating a new key on the subset could change the order and I need certainty that the original order is preserved.</p>
  
  <p>It is possible to get the <strong>Row numbers</strong> I need by using the two commands.</p>
  
  <pre><code>system.time(DT[, which(DT$Update==Exp$Update &amp; DT$Group==Exp$Group &amp; DT$Weight==Exp$Weight &amp; DT$Weight2==Exp$Weight2)])
  system.time(which(DT$Update==Exp$Update &amp; DT$Group==Exp$Group &amp; DT$Weight==Exp$Weight &amp; DT$Weight2==Exp$Weight2))
  </code></pre>
  
  <p>However I need a faster way to do that.</p>
  
  <p>Thank you for any suggestions.</p>