title: Can I nest a group-by within summarize in dplyr?
body: <p>Without using a join or merge I would like to add a <code>mean(metric)</code> column to this table, which averages the <code>metric</code> by <code>sector</code></p>
  
  <pre><code>  symbol       sector      date_bom     recommendation   metric
     A       Strip Center    20XX-08-01     BUY             0.01
     B       Office Center   20XX-09-01     BUY             0.02
     C       Strip Center    20XX-07-01     SELL           -0.01
  </code></pre>
  
  <p>I've tried a couple things in <code>dplyr</code>  but it seems like I want/need a group-by within the summarise clause, and that is not allowed. </p>