title: Plot ROC curve and calculate AUC in R at specific cutoff info
body: <p>Given such data:
  SN = Sensitivity;
  SP = Specificity</p>
  
  <pre><code>Cutpoint        SN   1-SP
         1       0.5    0.1
         2       0.7    0.2
         3       0.9    0.6
  </code></pre>
  
  <p>How can i plot the ROC curve and calculate AUC. And compare the AUC between two different ROC curves. In the most of the packages such pROC or ROCR, the input of the data is different from those shown above. Can anybody suggest the way to solve this problem in R or by something else?</p>
  
  <pre><code>ROCsdat &lt;- data.frame(cutpoint = c(5, 7, 9), TPR = c(0.56, 0.78, 0.91), FPR = c(0.01, 0.19, 0.58))
  
  ## plot version 1
  op &lt;- par(xaxs = "i", yaxs = "i")
  plot(TPR ~ FPR, data = dat, xlim = c(0,1), ylim = c(0,1), type = "n")
  with(dat, lines(c(0, FPR, 1), c(0, TPR, 1), type = "o", pch = 25, bg = "black"))
  text(TPR ~ FPR, data = dat, pos = 3, labels = dat$cutpoint)
  abline(0, 1)
  par(op)
  </code></pre>