xrobin / pROC

Display and analyze ROC curves in R and S+
https://cran.r-project.org/web/packages/pROC/
GNU General Public License v3.0
121 stars 31 forks source link

Error in while (cut_points[j] > t) { : missing value where TRUE/FALSE needed #60

Closed xrobin closed 5 years ago

xrobin commented 5 years ago
Data <- structure(list(Outcome = c(1L, 1L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 0L, 1L, 0L, 1L, 1L, 1L, 1L), Value = c(72L, 65L, 271L, 73L, 87L, 114L, 111L, 47L, 88L, 44L, 121L, 207L, 33L, 138L, 284L, 62L, 120L, 116L, 202L, 172L, 117L, 69L, 102L, 150L, 131L, 77L, 124L, 46L, 579L, 117L, 96L, 83L, 102L)), class = "data.frame", row.names = c(NA, -33L))
ROC <- roc(Outcome~Value, data=Data, ci=TRUE, direction="auto")
coords(ROC, x=-Inf, transpose = FALSE)

Shows the following error message:

Error in while (cut_points[j] > t) { : 
  missing value where TRUE/FALSE needed
3: roc.utils.thr.idx(roc, x) at coords.R#269
2: coords.roc(ROC, x = -Inf, transpose = FALSE) at coords.R#20
1: coords(ROC, x = -Inf, transpose = FALSE)

This might be related with the -Inf threshold and direction = ">" of the curve.