I am trying to use the pROC
package in R to calculate sensitivity, specificity and threshold level. Here is a sample data
library(pROC)
x<-sample(0:1,7974,replace=T)
y<-sample(0:16049.2,7974,replace=T)
myroc<-roc(x,y)
coords(myroc, "best", ret=c("threshold", "sensitivity", "specificity"))
Error in UseMethod("coords") :
no applicable method for 'coords' applied to an object of class "c('double', 'numeric')"
Will anyone be able to tell me why this error is happening and how to fix it?
Thank you