tests/testthat/test_str_eq_identity.r

test_that("general test", {

  test_node <- node("bmi", type="identity",
                    formula= ~ age / 2 + age^2 - ifelse(sex, 2, 3) + 2)

  out <- str_eq_identity(test_node)
  expect_equal(out, "bmi ~ age/2 + age^2 - ifelse(sex, 2, 3) + 2")
})

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.