tests/testthat/test-roc-curve.R

test_that("ROC_curve validates its inputs before plotting", {
  expect_error(
    ROC_curve(c(1, 0), c(0.8, 0.2), d = c(0.01, 0.05, 0.1)),
    "length 4"
  )
  expect_error(
    ROC_curve(c(1, 0), c(1.2, 0.2)),
    "probabilities"
  )
  expect_error(
    ROC_curve(c(1, 1), c(0.8, 0.2)),
    "both classes"
  )
})

Try the RobustMetrics package in your browser

Any scripts or data that you put into this service are public.

RobustMetrics documentation built on Aug. 21, 2026, 5:17 p.m.