title: Fitting several regression models with dplyr
body: <p>I would like to fit a model for each hour(the factor variable) using dplyr, I'm getting an error, and i'm not quite sure what's wrong.</p>
  
  <pre><code>df.h &lt;- data.frame( 
    hour     = factor(rep(1:24, each = 21)),
    price    = runif(504, min = -10, max = 125),
    wind     = runif(504, min = 0, max = 2500),
    temp     = runif(504, min = - 10, max = 25)  
  )
  
  df.h &lt;- tbl_df(df.h)
  df.h &lt;- group_by(df.h, hour)
  
  group_size(df.h) # checks out, 21 obs. for each factor variable
  
  # different attempts:
  reg.models &lt;- do(df.h, formula = price ~ wind + temp)
  
  reg.models &lt;- do(df.h, .f = lm(price ~ wind + temp, data = df.h))
  </code></pre>
  
  <p>I've tried various variations, but I can't get it to work. </p>