title: How to retrieve overall accuracy value from confusionMatrix in R?
body: <p>In R caret library, if I got a confusion matrix like this below, if there a way to retrieve the overall accuracy 0.992? I can't get this single value out, since I need to store this value and use it for later processing. Is this possible at all? </p>
  
  <pre><code> Prediction    A    B    C    D    E
            A 1114    2    0    0    0
            B    9  745    5    0    0
            C    0    6  674    4    0
            D    0    0    3  640    0
            E    0    0    2    1  718
  </code></pre>
  
  <p>Overall Statistics</p>
  
  <pre><code>            Accuracy : 0.992         
                95% CI : (0.989, 0.994)
   No Information Rate : 0.286         
   P-Value [Acc &gt; NIR] : &lt;2e-16        
  
                 Kappa : 0.99          
  </code></pre>
  
  <p>Mcnemar's Test P-Value : NA            </p>
  
  <p>Statistics by Class:</p>
  
  <pre><code>                     Class: A Class: B Class: C Class: D Class: E
   Sensitivity             0.992    0.989    0.985    0.992    1.000
   Specificity             0.999    0.996    0.997    0.999    0.999
   Pos Pred Value          0.998    0.982    0.985    0.995    0.996
   Neg Pred Value          0.997    0.997    0.997    0.998    1.000
   Prevalence              0.286    0.192    0.174    0.164    0.183
   Detection Rate          0.284    0.190    0.172    0.163    0.183
   Detection Prevalence    0.284    0.193    0.174    0.164    0.184
   Balanced Accuracy       0.996    0.992    0.991    0.996    1.000
  </code></pre>