diff --git a/R/check_dag.R b/R/check_dag.R index 1d64b2ee9..43a26c5c2 100644 --- a/R/check_dag.R +++ b/R/check_dag.R @@ -63,14 +63,17 @@ #' plot(dag) #' #' # After adjusting for `b`, the model is correctly specified -#' check_dag( +#' dag <- check_dag( #' y ~ x + b + c, #' x ~ b, #' outcome = "y", #' exposure = "x", #' adjusted = "b" #' ) +#' dag #' +#' # Objects returned by `check_dag()` can be used with "ggdag" or "dagitty" +#' ggdag::ggdag_status(dag) #' @export check_dag <- function(..., outcome = NULL, diff --git a/man/check_dag.Rd b/man/check_dag.Rd index 9597bcdc7..7e842dedb 100644 --- a/man/check_dag.Rd +++ b/man/check_dag.Rd @@ -88,12 +88,16 @@ dag plot(dag) # After adjusting for `b`, the model is correctly specified -check_dag( +dag <- check_dag( y ~ x + b + c, x ~ b, outcome = "y", exposure = "x", adjusted = "b" ) +dag + +# Objects returned by `check_dag()` can be used with "ggdag" or "dagitty" +ggdag::ggdag_status(dag) \dontshow{\}) # examplesIf} }