tests/testthat/test-convert.R

context("convert probs to LD")

test_that("Conversion works", {
  phat <- c(0.1, 0.2, 0.3, 0.4)
  temp <- convert_ld(phat = phat)

  phat <- c(0, 0.5, 0, 0.5)
  temp <- convert_ld(phat = phat)
  expect_equal(temp[["D"]], 0)
})

Try the ldsep package in your browser

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

ldsep documentation built on Oct. 19, 2022, 1:08 a.m.