title: Finding percentage in a sub-group using group_by and summarise
body: <p>I am new to dplyr and trying to do the following transformation without any luck. I've searched across the internet and I have found examples to do the same in ddply but I'd like to use dplyr.</p>
  
  <p>I have the following data:</p>
  
  <pre><code>   month   type  count
  1  Feb-14  bbb   341
  2  Feb-14  ccc   527
  3  Feb-14  aaa  2674
  4  Mar-14  bbb   811
  5  Mar-14  ccc  1045
  6  Mar-14  aaa  4417
  7  Apr-14  bbb  1178
  8  Apr-14  ccc  1192
  9  Apr-14  aaa  4793
  10 May-14  bbb   916
  ..    ...  ...   ...
  </code></pre>
  
  <p>I want to use dplyr to calculate the percentage of each type (aaa, bbb, ccc) at a month level i.e.</p>
  
  <pre><code>   month   type  count  per
  1  Feb-14  bbb   341    9.6%
  2  Feb-14  ccc   527    14.87%
  3  Feb-14  aaa  2674    ..
  ..    ...  ...   ...
  </code></pre>
  
  <p>I've tried</p>
  
  <pre><code>data %&gt;%
    group_by(month, type) %&gt;%
    summarise(count / sum(count))
  </code></pre>
  
  <p>This gives a 1 as each value. How do I make the sum(count) sum across all the types in the month?</p>