R Under development (unstable) (2024-05-15 r86556 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(testthat) > library(ROCit) > > > test_that("trapezoidarea is the area under curve using trapezoid rule", { + expect_equal(trapezoidarea(c(0,1),c(0,1)), 0.5) + expect_equal(trapezoidarea(c(0,0,1),c(0,1,1)), 1) + expect_equal(trapezoidarea(c(1,2,3),c(1,2,3)), 4) + expect_equal(trapezoidarea(c(1,11,16),c(1,3,2)), 32.5) + }) Test passed 😸 > > > test_that("invlogit computes logistic transform", { + expect_equal(plogis(0), 0.5) + expect_equal(plogis(-Inf), 0) + expect_equal(plogis(Inf), 1) + expect_equal(round(plogis(0.5),2), 0.62) + }) Test passed 🥳 > > > > > > proc.time() user system elapsed 0.71 0.15 0.87