title: dplyr: group mean centering (mutate + summarize)
body: <p>What is the efficient/preferred way to do group mean centering with dplyr, that is take each element of a group (<code>mutate</code>) and perform an operation on it and a summary stat (<code>summarize</code>) for that group.  Here's how one might do group mean centering on <code>mtcars</code> using base R:</p>
  
  <pre><code>do.call(rbind, lapply(split(mtcars, mtcars$cyl), function(x){ 
      x[["cent"]] &lt;- x$mpg - mean(x$mpg)
      x
  }))
  </code></pre>