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)
})

Try the bsseq package in your browser

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

bsseq documentation built on Nov. 8, 2020, 7:53 p.m.