tests/testthat/test-independent-testing-printmeta_adam.R

adsl <- r2rtf::r2rtf_adsl
adsl$TRTA <- adsl$TRT01A
adsl$TRTA <- factor(adsl$TRTA,
  levels = c("Placebo", "Xanomeline Low Dose", "Xanomeline High Dose")
)

adae <- r2rtf::r2rtf_adae
adae$TRTA <- factor(adae$TRTA,
  levels = c("Placebo", "Xanomeline Low Dose", "Xanomeline High Dose")
)

plan <- plan(
  analysis = "ae_summary", population = "apat",
  observation = c("wk12"), parameter = "rel"
)

meta <- meta_adam(
  population = adsl,
  observation = adae
) |>
  define_plan(plan = plan) |>
  define_population(
    name = "apat",
    group = "TRTA",
    subset = quote(SAFFL == "Y")
  ) |>
  define_observation(
    name = "wk12",
    group = "TRTA",
    subset = quote(SAFFL == "Y"),
    label = "Weeks 0 to 12"
  ) |>
  define_analysis(
    name = "ae_summary",
    title = "Summary of Adverse Events"
  )


test_that("meta print", {
  testthat::expect_snapshot(meta |> print())
})

Try the metalite package in your browser

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

metalite documentation built on Sept. 11, 2024, 7:18 p.m.