tests/testthat/test_utils.R

context("utils")

test_that("plogis()", {
    set.seed(666)
    x <- seq(-100, 100, 0.01)
    x <- x + runif(length(x), -0.001, 0.001)
    expect_equal(plogis(x), bsseq:::.oldTrans(x))
    # NOTE: There was a bug in .oldTrans() when x = 0 that mean it returned 0
    #       instead of 0.5
    expect_equal(bsseq:::.oldTrans(0), 0)
    expect_equal(plogis(0), 0.5)
})
kasperdanielhansen/bsseq documentation built on May 9, 2024, 4:11 p.m.