tests/testthat/test-partition_count.R

test_that("counting times in partition intervals", {
  t <- c(0.1, 1.1, 1.2, 2)
  p1 <- c(0, 1, 2)
  p2 <- c(0, 0.5, 1, 1.5, 2)

  expect_identical(
    partition_count(t, p1),
    c(1, 3)
    )
  expect_identical(
    partition_count(t, p2),
    c(1, 0, 2, 1)
  )
})
josbop/BayesBiSurv documentation built on June 15, 2020, 3:45 a.m.