tests/testthat/test-convertMassUnitsSI.R

test_that("convertMassUnitsSI", {
  expect_equal(convertMassUnitsSI(2, 'mg', 'kg'), 2e-6)
  expect_equal(convertMassUnitsSI(2, 'mg', 'ug'), 2e3)
  expect_equal(convertMassUnitsSI(2, 'g', 'ug'), 2e6)
})

Try the masscor package in your browser

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

masscor documentation built on Sept. 13, 2021, 9:06 a.m.