tests/testthat/test-simulate_data.R

set.seed(1234)
test_that("dags simulate correctly", {
  dag_sim <- simulate_data(test_dag, N = 50)
  expect_s3_class(dag_sim, "tbl")
  expect_length(dag_sim, 7)
  expect_equal(nrow(dag_sim), 50)
})

Try the ggdag package in your browser

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

ggdag documentation built on Sept. 11, 2024, 6:12 p.m.