Package: ggdag 0.2.13.9000

ggdag: Analyze and Create Elegant Directed Acyclic Graphs
Tidy, analyze, and plot directed acyclic graphs (DAGs). 'ggdag' is built on top of 'dagitty', an R package that uses the 'DAGitty' web tool (<https://dagitty.net/>) for creating and analyzing DAGs. 'ggdag' makes it easy to tidy and plot 'dagitty' objects using 'ggplot2' and 'ggraph', as well as common analytic and graphical functions, such as determining adjustment sets and node relationships.
Authors:
ggdag_0.2.13.9000.tar.gz
ggdag_0.2.13.9000.zip(r-4.7)ggdag_0.2.13.9000.zip(r-4.6)ggdag_0.2.13.9000.zip(r-4.5)
ggdag_0.2.13.9000.tgz(r-4.6-any)ggdag_0.2.13.9000.tgz(r-4.5-any)
ggdag_0.2.13.9000.tar.gz(r-4.7-any)ggdag_0.2.13.9000.tar.gz(r-4.6-any)
ggdag_0.2.13.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
card.svg |card.png
ggdag/json (API)
NEWS
| # Install 'ggdag' in R: |
| install.packages('ggdag', repos = c('https://r-causal.r-universe.dev', 'https://cloud.r-project.org')) |
Bug tracker:https://github.com/r-causal/ggdag/issues
Pkgdown/docs site:https://r-causal.github.io
causal-inferencedagggplot-extension
Last updated from:71997d8743. Checks:9 OK. Indexed: yes.
| Target | Result | Time | Files | Syslog |
|---|---|---|---|---|
| linux-devel-x86_64 | OK | 326 | ||
| source / vignettes | OK | 240 | ||
| linux-release-x86_64 | OK | 298 | ||
| macos-release-arm64 | OK | 272 | ||
| macos-oldrel-arm64 | OK | 262 | ||
| windows-devel | OK | 328 | ||
| windows-release | OK | 402 | ||
| windows-oldrel | OK | 367 | ||
| wasm-release | OK | 126 |
Exports:%>%activate_collider_pathsadjust_foraes_dagarrange_.tidy_dagittyas_tidy_dagittyas.tbl.tidy_dagittybutterfly_biascollider_triangleconfounder_trianglecontrol_forcoords2dfcoords2listcurve_edgecurveddagdag_adjustment_setsdag_labeldag_pathsdag_prunedag_saturatedagifydraw_key_dag_colliderdraw_key_dag_combineddraw_key_dag_edgedraw_key_dag_pointedge_backdoorexpand_plotfilterfilter_.tidy_dagittygeom_daggeom_dag_arrowgeom_dag_arrow_arcgeom_dag_arrowsgeom_dag_collider_edgesgeom_dag_edgesgeom_dag_edges_arcgeom_dag_edges_diagonalgeom_dag_edges_fangeom_dag_edges_linkgeom_dag_labelgeom_dag_label_repelgeom_dag_label_repel2geom_dag_nodegeom_dag_pointgeom_dag_textgeom_dag_text_repelgeom_dag_text_repel2ggdagggdag_adjacentggdag_adjustggdag_adjustment_setggdag_ancestorsggdag_butterfly_biasggdag_canonicalggdag_childrenggdag_classicggdag_colliderggdag_collider_triangleggdag_conditional_independenceggdag_confounder_triangleggdag_dconnectedggdag_defaultsggdag_descendantsggdag_drelationshipggdag_dseparatedggdag_equivalent_classggdag_equivalent_dagsggdag_exogenousggdag_instrumentalggdag_m_biasggdag_markov_blanketggdag_mediation_triangleggdag_optionggdag_option_proportionalggdag_options_getggdag_options_resetggdag_options_setggdag_parentsggdag_pathsggdag_paths_fanggdag_quartet_colliderggdag_quartet_confounderggdag_quartet_m_biasggdag_quartet_mediatorggdag_quartet_time_colliderggdag_statushas_labelsis_acyclicis_adjacentis_adjustment_setis_ancestoris_childis_collideris_confounderis_d_connectedis_d_separatedis_descendantis_downstream_collideris_exogenousis_exposureis_instrumentalis_latentis_outcomeis_parentis.tidy_dagittylabellabel<-m_biasmediation_trianglemutate_.tidy_dagittynode_adjacentnode_ancestorsnode_canonicalnode_childrennode_collidernode_dconnectednode_descendantsnode_drelationshipnode_dseparatednode_equivalent_classnode_equivalent_dagsnode_exogenousnode_instrumentalnode_markov_blanketnode_parentsnode_statuspull_dagpull_dag_dataquartet_colliderquartet_confounderquartet_m_biasquartet_mediatorquartet_time_colliderquery_adjustment_setsquery_ancestorsquery_childrenquery_collidersquery_conditional_independencequery_dconnectedquery_descendantsquery_dseparatedquery_exogenousquery_instrumentalquery_markov_blanketquery_parentsquery_pathsquery_statusremove_axesremove_gridscale_adjustedscale_dagselect_.tidy_dagittyset_curve_edgessimulate_dataslice_.tidy_dagittysummarise_.tidy_dagittytbl_df.tidy_dagittytest_conditional_independencetheme_dagtheme_dag_blanktheme_dag_graytheme_dag_gray_gridtheme_dag_greytheme_dag_grey_gridtheme_dag_gridtidy_dagittytime_ordered_coordsupdate_dagupdate_dag_data<-update_dag<-
Dependencies:base64encbootcachemclicpp11curldagittydplyrfarverfastmapforcatsgenericsggarrowggforceggplot2ggraphggrepelgluegraphlayoutsgridExtragtableigraphisobandjsonlitelabelinglatticelifecyclemagrittrMASSMatrixmemoisepillarpkgconfigpolyclippurrrR6RColorBrewerRcppRcppArmadillorlangS7scalesstringistringrsystemfontstibbletidygraphtidyrtidyselecttweenrutf8V8vctrsviridisviridisLitewithr
An Introduction to Directed Acyclic Graphs
Rendered fromintro-to-dags.Rmdusingknitr::rmarkdownon May 18 2026.Last update: 2025-08-10
Started: 2018-03-06
An Introduction to ggdag
Rendered fromintro-to-ggdag.Rmdusingknitr::rmarkdownon May 18 2026.Last update: 2025-08-10
Started: 2018-03-06
Common Structures of Bias
Rendered frombias-structures.Rmdusingknitr::rmarkdownon May 18 2026.Last update: 2025-08-10
Started: 2018-03-06
Readme and manuals
Help Manual
| Help page | Topics |
|---|---|
| Activate paths opened by stratifying on a collider | activate_collider_paths |
| Adjust for variables and activate any biasing paths that result | Adjust for variables adjust_for control_for ggdag_adjust |
| Define Aesthetics for Directed Acyclic Graphs (DAGs) | aes_dag |
| Convert DAGS to tidygraph | as_tbl_graph as_tbl_graph.dagitty as_tbl_graph.tidy_dagitty |
| Convert objects into 'tidy_dagitty' objects | as_tidy_dagitty as_tidy_dagitty.dagitty as_tidy_dagitty.data.frame as_tidy_dagitty.list |
| Convert a 'tidy_dagitty' object to data.frame | as.data.frame.tidy_dagitty |
| Convert a 'tidy_dagitty' object to tbl | as.tbl.tidy_dagitty as_tibble.tidy_dagitty |
| D-relationship between variables | Assess d-separation between variables ggdag_dconnected ggdag_drelationship ggdag_dseparated node_dconnected node_drelationship node_dseparated |
| Familial relationships between variables | Assess familial relationships between variables ggdag_adjacent ggdag_ancestors ggdag_children ggdag_descendants ggdag_markov_blanket ggdag_parents node_adjacent node_ancestors node_children node_descendants node_markov_blanket node_parents |
| Canonicalize a DAG | Canonicalize DAGs ggdag_canonical node_canonical |
| Find colliders | Colliders ggdag_collider node_collider |
| Manipulate DAG coordinates | coordinates coords2df coords2list |
| Covariate Adjustment Sets | Covariate Adjustment Sets dag_adjustment_sets ggdag_adjustment_set |
| Add or update curvature for a single edge | curve_edge |
| Mark an edge as curved in dagify formulas | curved |
| Create a dagitty DAG | dag |
| Directed DAG edges | DAG Edges geom_dag_edges_arc geom_dag_edges_diagonal geom_dag_edges_fan geom_dag_edges_link |
| DAG labels | DAG Labels dag_label has_labels label label<- label<-.dagitty label<-.tidy_dagitty |
| Saturate or prune an existing DAG | dag_prune dag_saturate |
| Create a dagitty DAG using R-like syntax | dagify |
| Dplyr verb methods for 'tidy_dagitty' objects | anti_join.tidy_dagitty arrange.tidy_dagitty arrange_.tidy_dagitty distinct.tidy_dagitty dplyr filter.tidy_dagitty filter_.tidy_dagitty full_join.tidy_dagitty group_by.tidy_dagitty inner_join.tidy_dagitty left_join.tidy_dagitty mutate.tidy_dagitty mutate_.tidy_dagitty right_join.tidy_dagitty select.tidy_dagitty select_.tidy_dagitty semi_join.tidy_dagitty slice.tidy_dagitty slice_.tidy_dagitty summarise.tidy_dagitty summarise_.tidy_dagitty transmute.tidy_dagitty ungroup.tidy_dagitty |
| Collider pattern legend key (many-to-one) | draw_key_dag_collider |
| Combined DAG legend key (horizontal node-edge-node) | draw_key_dag_combined |
| DAG edge legend key (arrow only) | draw_key_dag_edge |
| DAG point legend key (25% size) | draw_key_dag_point |
| Classify DAG edges as backdoor or direct | edge_backdoor |
| Generating Equivalent Models | Equivalent DAGs and Classes ggdag_equivalent_class ggdag_equivalent_dags node_equivalent_class node_equivalent_dags |
| Find Exogenous Variables | Exogenous Variables ggdag_exogenous node_exogenous |
| Quickly scale the size of a ggplot | expand_plot |
| Fortify a 'tidy_dagitty' object for 'ggplot2' | fortify fortify.dagitty fortify.tidy_dagitty |
| Add common DAG layers to a ggplot | geom_dag |
| Directed DAG edges using ggarrow | geom_dag_arrow geom_dag_arrows geom_dag_arrow_arc |
| Edges for paths activated by stratification on colliders | geom_dag_collider_edges |
| Directed and bidirected DAG edges | geom_dag_edges |
| Node text labels | geom_dag_label |
| Node text | geom_dag_text |
| Quickly plot a DAG in ggplot2 | ggdag |
| Quickly plot a DAG in ggplot2 | ggdag_classic |
| Global DAG Options | ggdag_defaults ggdag_option ggdag_options_get ggdag_options_reset ggdag_options_set ggdag_option_proportional |
| Create a new ggplot | ggplot.dagitty ggplot.tidy_dagitty |
| Repulsive textual annotations | geom_dag_label_repel geom_dag_label_repel2 geom_dag_text_repel geom_dag_text_repel2 ggrepel functions |
| Find Instrumental Variables | ggdag_instrumental Instrumental Variables node_instrumental |
| Assess if a variable confounds a relationship | is_confounder |
| Test DAG properties | is_acyclic is_adjustment_set is_dag_properties is_d_connected is_d_separated |
| Test node properties | is_exogenous is_exposure is_instrumental is_latent is_node_properties is_outcome |
| Test node relationships | is_adjacent is_ancestor is_child is_descendant is_node_relationships is_parent |
| Test for object class for tidy_dagitty | is.tidy_dagitty |
| DAG Nodes | geom_dag_node geom_dag_point Nodes |
| Find Open Paths Between Variables | dag_paths ggdag_paths ggdag_paths_fan Pathways |
| Print a 'tidy_dagitty' | print.tidy_dagitty |
| Pull components from DAG objects | pull_dag pull_dag.dagitty pull_dag.tidy_dagitty pull_dag_data pull_dag_data.dagitty pull_dag_data.tidy_dagitty update_dag update_dag.tidy_dagitty update_dag<- update_dag<-.tidy_dagitty update_dag_data<- update_dag_data<-.tidy_dagitty |
| Query Adjustment Sets | query_adjustment_sets |
| Query Node Ancestors | query_ancestors |
| Query Node Children | query_children |
| Query Collider Nodes | query_colliders |
| Query and Test Conditional Independence in a DAG | ggdag_conditional_independence query_conditional_independence test_conditional_independence |
| Query D-connection | query_dconnected |
| Query Node Descendants | query_descendants |
| Query D-separation | query_dseparated |
| Query Exogenous Variables | query_exogenous |
| Query Instrumental Variables | query_instrumental |
| Query Markov Blanket | query_markov_blanket |
| Query Node Parents | query_parents |
| Query Paths in a DAG | query_paths |
| Query Variable Status | query_status |
| Quickly create a DAGs with common structures of bias | butterfly_bias collider_triangle confounder_triangle ggdag_butterfly_bias ggdag_collider_triangle ggdag_confounder_triangle ggdag_mediation_triangle ggdag_m_bias ggdag_quartet_collider ggdag_quartet_confounder ggdag_quartet_mediator ggdag_quartet_m_bias ggdag_quartet_time_collider mediation_triangle m_bias quartet_collider quartet_confounder quartet_mediator quartet_m_bias quartet_time_collider Quick Plots for Common DAGs |
| Quickly remove plot axes and grids | remove_axes remove_grid |
| Common scale adjustments for DAGs | scale_adjusted scale_dag |
| Set curvature for multiple edges at once | set_curve_edges |
| Simulate Data from Structural Equation Model | simulate_data |
| Convert a 'tidy_dagitty' object to tbl_df | tbl_df.tidy_dagitty |
| Detecting colliders in DAGs | is_collider is_downstream_collider Test if Variable Is Collider |
| Minimalist DAG themes | theme_dag theme_dag_blank theme_dag_grid |
| Simple grey themes for DAGs | theme_dag_gray theme_dag_gray_grid theme_dag_grey theme_dag_grey_grid |
| Tidy a 'dagitty' object | tidy_dagitty |
| Create a time-ordered coordinate data frame | time_ordered_coords |
| Find variable status | ggdag_status node_status Variable Status |
