tests/testthat/test_pk_2cmt_t12_interval.R

test_that("List input matches vector input", {
  res_list <- pk_2cmt_t12_interval(
    CL = list(value = 5),
    V = list(value = 32),
    Q = list(value = 7),
    V2 = list(value = 21),
    tau = 24,
    t_inf = 1
  )
  res_vec <- pk_2cmt_t12_interval(
    CL = 5,
    V = 32,
    Q = 7,
    V2 = 21,
    tau = 24,
    t_inf = 1
  )
  expect_equal(res_list, res_vec)
  expect_equal(res_vec, 6.39156431)
})

test_that("t12 doesn't go to infinity for bolus due to infinitisimal issues", {
  res_bolus <- pk_2cmt_t12_interval(
    CL = 5,
    V = 32,
    Q = 7,
    V2 = 21,
    tau = 24
  )
  expect_equal(res_bolus, 6.16696475)
})

Try the clinPK package in your browser

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

clinPK documentation built on May 9, 2022, 9:06 a.m.