Skip to content

Error in check_dag? #878

@Pakillo

Description

@Pakillo

Thanks for the package!

check_dag reports a somewhat cryptic error with some DAGs. Reproducible example below (a bit weird DAG, I know...)

Thanks!

library(performance)

check_dag(
  y ~ x + a + b,
  a ~ c + d,
  b ~ c + d,
  outcome = "y",
  exposure = "x",
  adjusted = ~ a + b
)
#> Error in !is.null(collider) && collider %in% adjustment_nodes: 'length = 2' in coercion to 'logical(1)'

Created on 2025-12-10 with reprex v2.1.1

Session info

sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.5.2 (2025-10-31)
#>  os       Ubuntu 24.04.3 LTS
#>  system   x86_64, linux-gnu
#>  ui       X11
#>  language en_GB:en
#>  collate  en_GB.UTF-8
#>  ctype    en_GB.UTF-8
#>  tz       Europe/Madrid
#>  date     2025-12-10
#>  pandoc   3.6.3 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/tools/x86_64/ (via rmarkdown)
#>  quarto   1.7.32 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/quarto
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package      * version     date (UTC) lib source
#>  boot           1.3-32      2025-08-29 [3] RSPM (R 4.5.0)
#>  cli            3.6.5       2025-04-23 [3] RSPM (R 4.4.0)
#>  curl           7.0.0       2025-08-19 [3] RSPM (R 4.5.0)
#>  dagitty        0.3-4       2023-12-07 [3] RSPM (R 4.4.0)
#>  digest         0.6.39      2025-11-19 [3] CRAN (R 4.5.2)
#>  dplyr          1.1.4       2023-11-17 [3] RSPM (R 4.4.0)
#>  evaluate       1.0.5       2025-08-27 [3] RSPM (R 4.5.0)
#>  farver         2.1.2       2024-05-13 [3] RSPM (R 4.4.2)
#>  fastmap        1.2.0       2024-05-15 [3] RSPM (R 4.4.2)
#>  fs             1.6.6       2025-04-12 [3] RSPM (R 4.4.0)
#>  generics       0.1.4       2025-05-09 [3] RSPM (R 4.5.0)
#>  ggdag          0.2.13.9000 2025-10-21 [1] Github (r-causal/ggdag@3a93a5e)
#>  ggplot2        4.0.1       2025-11-14 [3] CRAN (R 4.5.2)
#>  glue           1.8.0       2024-09-30 [3] RSPM (R 4.4.2)
#>  gtable         0.3.6       2024-10-25 [3] RSPM (R 4.4.0)
#>  htmltools      0.5.9       2025-12-04 [3] CRAN (R 4.5.2)
#>  igraph         2.2.1       2025-10-27 [3] RSPM (R 4.5.0)
#>  insight        1.4.4       2025-12-06 [3] CRAN (R 4.5.2)
#>  jsonlite       2.0.0       2025-03-27 [3] RSPM (R 4.4.0)
#>  knitr          1.50        2025-03-16 [3] RSPM (R 4.4.0)
#>  lifecycle      1.0.4       2023-11-07 [3] RSPM (R 4.4.0)
#>  magrittr       2.0.4       2025-09-12 [3] RSPM (R 4.5.0)
#>  MASS           7.3-65      2025-02-28 [3] RSPM (R 4.4.0)
#>  performance  * 0.15.3      2025-12-01 [3] CRAN (R 4.5.2)
#>  pillar         1.11.1      2025-09-17 [3] RSPM (R 4.5.0)
#>  pkgconfig      2.0.3       2019-09-22 [3] RSPM (R 4.4.0)
#>  purrr          1.2.0       2025-11-04 [3] RSPM (R 4.5.0)
#>  R6             2.6.1       2025-02-15 [3] RSPM (R 4.4.0)
#>  RColorBrewer   1.1-3       2022-04-03 [3] RSPM (R 4.4.0)
#>  Rcpp           1.1.0       2025-07-02 [3] RSPM (R 4.5.0)
#>  reprex         2.1.1       2024-07-06 [3] RSPM (R 4.4.0)
#>  rlang          1.1.6       2025-04-11 [3] RSPM (R 4.4.0)
#>  rmarkdown      2.30        2025-09-28 [3] RSPM (R 4.5.0)
#>  rstudioapi     0.17.1      2024-10-22 [3] RSPM (R 4.4.0)
#>  S7             0.2.1       2025-11-14 [3] CRAN (R 4.5.2)
#>  scales         1.4.0       2025-04-24 [3] RSPM (R 4.4.0)
#>  sessioninfo    1.2.3       2025-02-05 [3] RSPM (R 4.4.0)
#>  stringi        1.8.7       2025-03-27 [3] RSPM (R 4.4.0)
#>  stringr        1.6.0       2025-11-04 [3] RSPM (R 4.5.0)
#>  tibble         3.3.0       2025-06-08 [3] RSPM (R 4.5.0)
#>  tidygraph      1.3.1       2024-01-30 [3] RSPM (R 4.4.0)
#>  tidyr          1.3.1       2024-01-24 [3] RSPM (R 4.4.0)
#>  tidyselect     1.2.1       2024-03-11 [3] RSPM (R 4.4.0)
#>  V8             8.0.1       2025-10-10 [3] RSPM (R 4.5.0)
#>  vctrs          0.6.5       2023-12-01 [3] RSPM (R 4.4.0)
#>  withr          3.0.2       2024-10-28 [3] RSPM (R 4.4.0)
#>  xfun           0.54        2025-10-30 [3] RSPM (R 4.5.0)
#>  yaml           2.3.12      2025-12-10 [3] CRAN (R 4.5.2)
#> 
#>  [1] /home/frs/R/x86_64-pc-linux-gnu-library/4.0
#>  [2] /usr/local/lib/R/site-library
#>  [3] /usr/lib/R/site-library
#>  [4] /usr/lib/R/library
#>  * ── Packages attached to the search path.
#> 
#> ──────────────────────────────────────────────────────────────────────────────

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions