title: how to calculate percentage from a vector of counts
body: <p>I have a data.frame that looks like this: </p>
  
  <pre><code>&gt; dat &lt;- data.frame(Operation = c("Login", "Posted", "Deleted"), `Total Count` = c(5, 25, 40), check.names = FALSE)
  &gt; dat
    Operation Total Count
  1     Login           5
  2    Posted          25
  3   Deleted          40
  </code></pre>
  
  <p>I want to calculate the percentage for each Operation, e.g., what percentage of Operations were <code>Login</code>.  I'd expect a result like:</p>
  
  <pre><code>  Operation Total Count Percentage
  1     Login           5 0.07142857
  2    Posted          25 0.35714286
  3   Deleted          40 0.57142857
  </code></pre>
  
  <p>Since the counts are already summarized, <code>table()</code> doesn't work:</p>
  
  <pre><code>&gt; table(dat$`Total Count`)
  
   5 25 40 
   1  1  1 
  </code></pre>