Skip to content

Commit

Permalink
revise print
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Sep 13, 2024
1 parent b9d4917 commit 0d42eaa
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions R/check_dag.R
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,22 @@ print.check_dag <- function(x, ...) {
)
}
if (is.null(out$current_adjustments)) {
msg <- paste0(msg, "\nCurrently, the model does not adjust for any variables.")
msg <- paste0(msg, " Currently, the model does not adjust for any variables.")
} else {
msg <- paste0(
msg, "\nCurrently, the model only adjusts for ",
insight::color_text(datawizard::text_concatenate(out$current_adjustments, enclose = "`"), "yellow"), "."
msg, " Currently, the model only adjusts for ",
datawizard::text_concatenate(out$current_adjustments, enclose = "`"),
"."
)
# check if we could identify missing variables, and if so, add them to the message
missing_vars <- setdiff(unlist(out$minimal_adjustments), out$current_adjustments)
if (length(missing_vars) > 0) {
msg <- paste0(
msg, " You possibly also need to adjust for ",
insight::color_text(datawizard::text_concatenate(missing_vars, enclose = "`"), "yellow"),
" to block biasing paths."
)
}
}
}

Expand Down

0 comments on commit 0d42eaa

Please sign in to comment.