tests/testthat/test_get_formula_for_node_lmer.r

test_that("general test case", {

  # a single random effect
  out <- get_formula_for_node_lmer(c("A", "B", "C"), "(1|D)")
  expect_equal(out, ...PLACEHOLDER... ~ A + B + C + (1 | D),
               ignore_formula_env=TRUE)

  # multiple random effects
  out <- get_formula_for_node_lmer(c("A", "B", "C"), c("(1|D)", "(G|F)"))
  expect_equal(out, ...PLACEHOLDER... ~ A + B + C + (1 | D) + (G | F),
               ignore_formula_env=TRUE)
})

Try the simDAG package in your browser

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

simDAG documentation built on April 3, 2025, 10:35 p.m.