inst/tinytest/test-nmbf01.R

library(tinytest)
library(bfpwr)

expect_true(is.numeric(nmbf01(estimate = 0, se = 1, null = 0, psd = 1, log = FALSE)),
            info = "nmbf01 should return a numeric value")

expect_true(length(nmbf01(estimate = c(-1, 0, 1), se = 1, null = 0, psd = 1, log = FALSE)) == 3,
            info = "nmbf01 should handle vector inputs")

expect_equal(nmbf01(estimate = 0, se = 1, null = 0, psd = 1, log = TRUE),
             log(nmbf01(estimate = 0, se = 1, null = 0, psd = 1, log = FALSE)),
             info = "nmbf01 should return log(nmbf01) when log = TRUE")

Try the bfpwr package in your browser

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

bfpwr documentation built on June 8, 2025, 1:40 p.m.