title: R data.table apply function to rows using columns as arguments
body: <p>I have the following <code>data.table</code></p>
  
  <pre><code>x = structure(list(f1 = 1:3, f2 = 3:5), .Names = c("f1", "f2"), row.names = c(NA, -3L), class = c("data.table", "data.frame"))
  </code></pre>
  
  <p>I would like to apply a function to each row of the <code>data.table</code>. The function <code>func.test</code> uses args <code>f1</code> and <code>f2</code> and does something with it and returns a computed value. Assume (as an example)</p>
  
  <pre><code>func.text &lt;- function(arg1,arg2){ return(arg1 + exp(arg2))}
  </code></pre>
  
  <p>but my real function is more complex and does loops and all, but returns a computed value.
  What would be the best way to accomplish this? </p>