title: data frame column total in R
body: <p>I have data like this (derived using the <code>table()</code> function):</p>
  <pre><code>dat &lt;- read.table(text = &quot;responses freq percent
  A           9   25.7
  B          13   37.1
  C          10   28.6
  D           3    8.6&quot;, header = TRUE)
  
  dat
  
  responses freq percent
  A           9   25.7
  B          13   37.1
  C          10   28.6
  D           3    8.6
  </code></pre>
  <p>All I want are row totals, so to create a new row at the bottom that says Total and then in column <code>freq</code> it will show 35 and in <code>percent</code> it will show 100. I am unable to find a solution. <code>colSums</code> doesn't work because of the first column which is a string.</p>