Detects any colliders given a DAG. node_collider tags colliders and ggdag_collider plots all exogenous variables.
node_collider
ggdag_collider
node_collider(.dag, as_factor = TRUE, ...)ggdag_collider(.tdy_dag, ..., edge_type = "link_arc", node_size = 16, text_size = 3.88, label_size = text_size, text_col = "white", label_col = text_col, node = TRUE, stylized = TRUE, text = TRUE, use_labels = NULL)
ggdag_collider(.tdy_dag, ..., edge_type = "link_arc", node_size = 16, text_size = 3.88, label_size = text_size, text_col = "white", label_col = text_col, node = TRUE, stylized = TRUE, text = TRUE, use_labels = NULL)
input graph, an object of class tidy_dagitty or dagitty
tidy_dagitty
dagitty
treat collider variable as factor
collider
additional arguments passed to tidy_dagitty()
tidy_dagitty()
a character vector, the edge geom to use. One of: "link_arc", which accounts for directed and bidirected edges, "link", "arc", or "diagonal"
size of DAG node
size of DAG text
size of label text
color of DAG text
color of label text
logical. Should nodes be included in the DAG?
logical. Should DAG nodes be stylized? If so, use geom_dag_nodes and if not use geom_dag_point
geom_dag_nodes
geom_dag_point
logical. Should text be included in the DAG?
a string. Variable to use for geom_dag_repel_label(). Default is NULL.
geom_dag_repel_label()
NULL
a tidy_dagitty with a collider column for colliders or a ggplot
ggplot
# NOT RUN { dag <- dagify(m ~ x + y, y ~ x) node_collider(dag) ggdag_collider(dag) # }
Run the code above in your browser using DataCamp Workspace