title: R, Confusion Matrix in percent
body: <p>In R how to get Confusion Matrix in percent (or fraction of 1).
  The "caret" package provides useful function but shows absolute number of samples.</p>
  
  <pre><code>library(caret)
  data(iris)
  T &lt;- iris$Species
  P &lt;- sample(iris$Species)
  confusionMatrix(P, T)
  Confusion Matrix and Statistics
               Reference
  Prediction   setosa versicolor virginica
  setosa         15         16        19
  versicolor     19         16        15
  virginica      16         18        16
  </code></pre>