title: R - Parallelizing multiple model learning (with dplyr and purrr)
body: <p>This is a follow up to a <a href="https://stackoverflow.com/q/38230957/209882">previous question</a> about learning multiple models.</p>
  
  <p>The use case is that I have multiple observations for each subject, and
  I want to train a model for each of them. See Hadley's <a href="http://edinbr.org/edinbr/2016/05/11/may-Hadley-Update2-PostingTalk.html" rel="noreferrer">excellent presentation</a> on how to do this.</p>
  
  <p>In short, this is possible to do using <code>dplyr</code> and <code>purrr</code> like so:</p>
  
  <pre><code>library(purrr)
  library(dplyr)
  library(fitdistrplus)
  dt %&gt;% 
      split(dt$subject_id) %&gt;%
      map( ~ fitdist(.$observation, "norm")) 
  </code></pre>
  
  <p>So since the model building is an embarrassingly parallel task, I was
  wondering if <code>dplyr</code>, <code>purrr</code> have an easy to use parallelization mechanism for such tasks (like a parallel <code>map</code>).</p>
  
  <p>If these libraries don't provide easy parallelization could it be done using the classic R parallelization libraries (<code>parallel</code>, <code>foreach</code> etc)?</p>