tests/testthat/test_calc_dosing_weight.R

test_that("Dosing weight is calculated", {
  expect_equal(
    round(
      calc_dosing_weight(
        weight = 160,
        height = 160,
        age= 50,
        sex = "female",
        verbose = FALSE
      )$value,
      1
    ),
    95.4
  )
  expect_equal(
    round(
      calc_dosing_weight(
        weight = 60,
        height = 160,
        age= 50,
        sex = "female",
        verbose = FALSE
      )$value,
      1
    ),
    52.4
  )
  expect_equal(
    round(
      calc_dosing_weight(
        weight = 50,
        height = 160,
        age= 50,
        sex = "female",
        verbose = FALSE
      )$value,
      1
    ),
    50
  )
})

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.