tests/testthat/test_utils-predict.R

test_that("cutpoints", {
    x <- seq(0, 1, length.out = 10)
    expect_equal(cutpoints(x, n = 5), c(0, 0.5, 1))
    expect_equal(cutpoints(x, n = 10), c(0, 1))
    expect_equal(as.vector(table(.cut(x, cutpoints(x, n = 2)))), rep(2, 5))
})
ampel-leipzig/ameld documentation built on Aug. 23, 2024, 7:31 p.m.