Skip to content

Commit

Permalink
add attr
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Aug 3, 2024
1 parent dd024fb commit 34baa39
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/check_dag.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ check_dag.default <- function(...,
dag <- .adjust_dag(dag, adjusted)
}

.finalize_dag(dag, effect, outcome, exposure)
.finalize_dag(dag, effect, outcome, exposure, adjusted)
}


# helper ----------------------------------------------------------------------

.finalize_dag <- function(dag, effect, outcome, exposure) {
.finalize_dag <- function(dag, effect, outcome, exposure, adjusted) {
# data for checking effects
checks <- lapply(c("direct", "total"), function(x) {
adjustment_set <- unlist(dagitty::adjustmentSets(dag, effect = x), use.names = FALSE)
Expand All @@ -172,6 +172,7 @@ check_dag.default <- function(...,
attr(dag, "effect") <- effect
attr(dag, "outcome") <- outcome
attr(dag, "exposure") <- exposure
attr(dag, "adjusted") <- adjusted
attr(dag, "check_direct") <- insight::compact_list(checks[[1]])
attr(dag, "check_total") <- insight::compact_list(checks[[2]])

Expand Down

0 comments on commit 34baa39

Please sign in to comment.