View source: R/saturate_and_prune.R
dag_saturate | R Documentation |
dag_saturate()
takes a tidy DAG object and, optionally using existing
coordinates, saturates the DAG based on time ordering of the nodes. To create
a saturated DAG from scratch, see as_tidy_dagitty.list()
. dag_prune()
takes an existing DAG and removes edges. This is most useful when used
together with saturated DAG.
dag_saturate(
.tdy_dag,
use_existing_coords = FALSE,
layout = "time_ordered",
seed = NULL,
...
)
dag_prune(.tdy_dag, edges)
.tdy_dag |
A tidy DAG object. |
use_existing_coords |
Logical, indicating whether to use existing node coordinates. |
layout |
a layout available in |
seed |
a numeric seed for reproducible layout generation |
... |
optional arguments passed to |
edges |
A named character vector where the name is the starting node and
the value is the end node, e.g. |
A tidy_dagitty
object
as_tidy_dagitty.list()
# Example usage:
dag <- dagify(y ~ x, x ~ z)
saturated_dag <- dag_saturate(dag)
saturated_dag %>%
ggdag(edge_type = "arc")
saturated_dag %>%
dag_prune(c("x" = "y")) %>%
ggdag(edge_type = "arc")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.