title: Error in sum(count) : invalid 'type' (closure) of argument
body: <p>I have an order table that looks like this:</p>
  <pre><code>country_code other_info order_status
  FR           1523       okay
  FR           5151       not_okay
  FR           41511      not_okay
  IE           5151       okay
  </code></pre>
  <p>Both columns are of class character but even when transforming them into factors I got the same issue.</p>
  <p>I just want to have the proportions of order_status grouped by country_code.</p>
  <p>After running the following code I've got this error and I really cannot figure out what it means:</p>
  <pre><code>'Error in sum(count) : invalid 'type' (closure) of argument 
  </code></pre>
  <pre><code>library(dplyr)
  orders %&gt;%
    group_by(country_code) %&gt;%
    mutate(countT= sum(count)) %&gt;%
    group_by(order_status, add=TRUE) %&gt;%
    mutate(per=paste0(round(100*count/countT,2),'%'))
  </code></pre>
  <p>What I want is this:</p>
  <pre><code>country_code order_status per
  FR           okay         33%
  FR           not_okay     66%
  IE           okay         100%
  </code></pre>
  <p>Thank you very much for your help, I'm sure it's something not complicated.</p>