Skip to content

Commit

Permalink
fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Aug 11, 2024
1 parent 1c83b1f commit 98e94cb
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions R/check_dag.R
Original file line number Diff line number Diff line change
Expand Up @@ -316,17 +316,22 @@ print.check_dag <- function(x, ...) {
cat(exposure_outcome_text)
cat("\n\n")

for (i in c("direct", "total")) {
if (i == "direct") {
out <- attributes(x)$check_direct
} else {
out <- attributes(x)$check_total
# minimal adjustment sets for direct and total effect identical?
# Then print only once
if (identical(attributes(x)$check_direct$minimal_adjustments, attributes(x)$check_total$minimal_adjustments)) {
.print_dag_results(attributes(x)$check_direct, x, "direct and total", "all")
} else {
for (i in c("direct", "total")) {
if (i == "direct") {
out <- attributes(x)$check_direct
} else {
out <- attributes(x)$check_total
}
.print_dag_results(out, x, i, effect)
}
.print_dag_results(out, x, i, effect)
}
}


.print_dag_results <- function(out, x, i, effect) {
# missing adjustements - minimal_adjustment can be a list of different
# options for minimal adjustements, so we check here if any of the minimal
Expand Down

0 comments on commit 98e94cb

Please sign in to comment.