title: Sum of cells with same row and column name in R
body: <p>I have a matrix created using <code>table()</code> command in R in which rows and columns do not have same values. </p>
  
  <pre><code>       0   1   2 
    1    1   2   3  
    2    4   5   6  
    3    7   7   8  
  </code></pre>
  
  <p>How can I sum the elements with the same row and column name? In this example it is equal to (2+6=)8.</p>