tests/testthat/test-tpm.R

test_that("row sums are equal to one (for two states)", {
  param = rep(-1, 2)
  expect_equal(rowSums(tpm(param)), c(S1 = 1, S2 = 1))
})

test_that("row sums are equal to one (for three states)", {
  param = rep(-2, 6)
  expect_equal(rowSums(tpm(param)), c(S1 = 1, S2 = 1, S3 = 1))
})

Try the LaMa package in your browser

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

LaMa documentation built on Nov. 5, 2025, 6:42 p.m.