tests/testthat/test-status.R

set.seed(1234)

test_that("dags have correct status", {
  test_dag <- dagify(
    l ~ x + y,
    y ~ x,
    exposure = "x",
    outcome = "y",
    latent = "l"
  )

  p <- ggdag_status(test_dag)

  expect_doppelganger("ggdag_status() `x` as exposure, `y` as outcome, and `l` as latent", p)
})

Try the ggdag package in your browser

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

ggdag documentation built on May 31, 2023, 7:48 p.m.