tests/testthat/test_subsample_data.R

test_that("Subsample uses denser steps early and wider steps later", {
  d = simulate_breathtest_data(
    n_records = 1,
    first_minute = 1,
    step_minute = 1
  )$data
  comment(d) = "comment"
  d1 = subsample_data(cleanup_data(d), 15)
  tt = as.integer(table(diff(d1$minute)))
  expect_equal(comment(d), "comment")
  expect_equal(tt, c(6, 3, 1, 4))
})

Try the breathtestcore package in your browser

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

breathtestcore documentation built on July 13, 2026, 5:09 p.m.