title: how can I implement "by" function in parallel, or preferably by sparkR
body: <p>I need to apply "by" function on a very big data set. The data looks like:</p>
  
  <pre><code>id    value1   value2
  1      245      446
  1      592      567
  1      356      642
  ...    ...
  2      231      421
  2      423      425
  2      421      542
  </code></pre>
  
  <p>I need to calculate something between value1 and value2 for each id, so that:</p>
  
  <pre><code>by(dataset, id, function(input) myfun(input$value1, input$value2) 
  </code></pre>
  
  <p>However, the data is very very big. Such computation requires a lot of time.</p>
  
  <p>I would like to know, is there anyway to speed up this function.</p>
  
  <p>I want to use parallel method, preferably using sparkR. But I don't know how to get this done. Can SparkR support it?</p>