title: Retrieve classifier performance metrics from ROCR prediction object
body: <p>I use ROCR to get measurements of the performance of various classification algorithms on my dataset. While I can retrieve the AUC metric relatively easily using the following code sample:</p>
  
  <pre><code>predictions &lt;- predict(rfmodel, test, type="prob")
  pred.obj &lt;- prediction(predictions[,2], data$response)
  rfperf &lt;- performance(pred.obj, "tpr","fpr")
  print(sprintf("random forest AUC %f", as.numeric(performance(pred.obj,"auc")@y.values)))
  </code></pre>
  
  <p>I have trouble retrieving other retrieving other measures like precision, recall, f etc as a single value that I could include in a table in my paper. I have tried the following:</p>
  
  <pre><code>&gt; p &lt;- performance(pred.obj,"prec", "rec")
  &gt; as.numeric(p@x.values)
  Error: (list) object cannot be coerced to type 'double'
  </code></pre>
  
  <p>I can plot the values, but this is not what I would like. Any ideas?</p>