title: Is there a function in R to reduce a big confusion matrix to a 2x2 positive-negative level confusion matrix in R?
body: <p>Say we have the following confusion matrix:</p>
  <pre><code>a &lt;- round(matrix(runif(100,1,100), nrow=10),0)
  colnames(a) &lt;- LETTERS[1:10]
  rownames(a) &lt;- LETTERS[1:10]
  a
      A  B  C  D  E  F  G  H  I  J
  A  42 35  1  9 83 26  4 21 82  4
  B 100 53 28 33 52 62 73 85 53 49
  C  26 12 33 63 57  4 46 61 21 55
  D  51 89 59 45  1 15 57 76 85 84
  E   9 95 26 80 15 71 87 57 38 73
  F  82  5  5 29 87  7 56 28 31 56
  G  39 50 12 58  9 63 74 74 77  8
  H  80 23 71  5 25 94 63 55 74 15
  I  21 86 94 20 98 10 32 35 84 69
  J  95 54 32 73 58 97 40 52 57 11
  </code></pre>
  <p>Considering that columns are actual values and rows predicted values, is there a function that can use this matrix to output a 2 x 2 (TP/TN/FP/FN) confusion matrix where, for example, A would be the positive level and the rest of the letters would form the negative level?  Thanks!</p>