title: In R: calculate Area Under Precision/Recall Curve (AUPR)?
body: <p>Suppose I have two matrices: A for Label matrix and B for corresponding predicted probability matrix of A. Now I would like to calculate the the AUPR (Area Under Precision/Recall Curve) according to matrices A and B. For common AUC (Area Under ROC Curve), there are many packages in R, such as ROCR, pROC, can directly calculate the AUC value, but currently, what packages in R can calculate the AUPR? or Can you help give the method the compute the AUPR?
  Here is the two example matrics: </p>
  
  <pre><code>&gt; pp
          [,1]    [,2]     [,3]    [,4]    [,5]     [,6]    [,7]
  [1,] 0.01792 0.00155 -0.00140 0.00522 0.01320  0.22506 0.00454
  [2,] 0.05883 0.11256  0.82862 0.12406 0.08298 -0.00392 0.30724
  [3,] 0.00743 0.06357  0.14500 0.00213 0.00545  0.03452 0.11189
  [4,] 0.02571 0.01460  0.01108 0.00494 0.01246  0.11880 0.05504
  [5,] 0.02407 0.00961  0.00720 0.00382 0.01039  0.10974 0.04512
  
  &gt; ll
          D00040 D00066 D00067 D00075 D00088 D00094 D00105
  hsa190       0      0      0      0      0      1      0
  hsa2099      0      1      1      0      0      0      1
  hsa2100      0      0      0      0      0      0      1
  hsa2101      0      0      0      0      0      0      0
  hsa2103      0      0      0      0      0      0      0
  </code></pre>
  
  <p><code>pp</code> is the predicted probability matrix for the true label <code>ll</code> matrix, and <code>ll</code> is just the label matrix.</p>
  
  <p>Thanks in advance.</p>