title: data.table compute column filter
body: <p>I'm trying to compute a column using data.table; </p>
  
  <p>The goal here is to compute a <code>speedup</code> column for the runtime, relative to 1 thread. </p>
  
  <pre><code>    setup       mode name threads runtime
   1:     A      short    K       1      10
   2:     A      short    K       1      11
   3:     A      short    K       1      10
   4:     A      short    K       2       4
   5:     A      short    K       2       5
   6:     A      short    K       2       8
   7:     B      short    K       1      11
   8:     B      short    K       1      12
   9:     B      short    K       1      10
  10:     B      short    K       2       9
  11:     B      short    K       2       6
  12:     B      short    K       2       8
  </code></pre>
  
  <p>Here's what I got to... </p>
  
  <pre><code>valT[, speedup:=mean(runtime)/runtime, by=c("setup","threads","name","mode") ]
  </code></pre>
  
  <p>Of course, the speedups that come out aren't what I want though; For example, the first row speedup computed should be 1.1; for the 4th should be 2.75. This is why I need to narrow the selection. <code>which</code> seemed to be the answer, but I can't deploy it correctly: </p>
  
  <pre><code>valT[, speedup:=mean(runtime)/runtime, which(threads==1), by=c("setup","threads","name","mode") ]
      Error in `[.data.table`(valT, , runtime/mean(runtime), which(threads ==  : 
        Provide either 'by' or 'keyby' but not both
  </code></pre>
  
  <hr>
  
  <p>Data: </p>
  
  <pre><code>valT = data.table(structure(list(setup = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 
  2L, 2L, 2L, 2L, 2L), .Label = c("A", "B"), class = "factor"), 
      mode = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
      1L, 1L), .Label = "     short", class = "factor"), name = structure(c(1L, 
      1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "  K", class = "factor"), 
      threads = c(1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L
      ), runtime = c(10, 11, 10, 4, 5, 8, 11, 12, 10, 9, 6, 8)), .Names = c("setup", 
  "mode", "name", "threads", "runtime"), class = "data.frame", row.names = c(NA, 
  -12L)))
  </code></pre>