title: add AUC by group on roc plots in R
body: <p>I have roc plots for 4 groups, I want to add auc values for each group in the legend:</p>
  
  <pre><code>## draw plots
  basicplot &lt;- ggplot(roc_long, aes(d = outcome, m = prediction, color = model)) + geom_roc(n.cuts = 0) + 
  +   style_roc(theme = theme_bw, xlab = "1-Specificity", ylab = "Sensitivity") 
  ## calculate auc
  calc_auc(basicplot)
        PANEL group       AUC
      1     1     1 0.7718926
      2     1     2 0.9296029
      3     1     3 0.7790979
      4     1     4 0.8235286
  
  annotate &lt;- basicplot + 
       ggtitle("ROC plots for 4 outcomes") +
       theme(plot.title = element_text(hjust = 0.5)) +
       annotate("text", x = .75, y = .25, label = paste("AUC =", round(calc_auc(basicplot)["AUC"], 3)))
  
       annotate
  </code></pre>
  
  <p>My plots looks like this:
  <a href="https://i.stack.imgur.com/TeJvF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TeJvF.png" alt="enter image description here"></a>
  How can I add AUC to each group on the right?</p>
  
  <p>Thanks!</p>