tests/testthat/test-t_dm_slide.R

test_that("Test demographic table creation of t_dm_slide", {
  adsl <- eg_adsl
  expect_snapshot(t_dm_slide(adsl, "TRT01P", c("SEX", "AGE", "RACE", "ETHNIC", "COUNTRY")))

  expect_snapshot(t_dm_slide(adsl, "TRT01P", c("SEX", "AGE", "RACE", "ETHNIC", "COUNTRY"),
    split_by_study = FALSE,
    side_by_side = "GlobalChina"
  ))

  expect_snapshot(t_dm_slide(adsl, "TRT01P", c("SEX", "AGE", "RACE", "ETHNIC", "COUNTRY"),
    split_by_study = TRUE
  ))

  expect_warning(t_dm_slide(adsl, "TRT01P", c("SEX", "AGE", "RACE", "ETHNIC", "COUNTRY"),
    split_by_study = TRUE, side_by_side = "GlobalChina"
  ))
  expect_snapshot(t_dm_slide(adsl, "TRT01P", c("SEX", "AGE", "RACE", "ETHNIC", "COUNTRY"),
    split_by_study = TRUE, side_by_side = "GlobalChina"
  ))
})

Try the autoslider.core package in your browser

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

autoslider.core documentation built on April 4, 2025, 2:05 a.m.