Take a DAG graph object and, in the simplest case, create a single-world intervention
template corresponding to a world in which the fixed nodes are set to a given value.
Alternatively, tell qd_swig() which values fixed nodes will be set to.
Usage
qd_swig(
graph_obj,
fixed_nodes,
custom_values = NULL,
fixed_sep = "vlin",
sep_point_size = 15
)Arguments
- graph_obj
A DAG object created by
qd_dag().- fixed_nodes
A vector containing the nodes to be intervened upon.
- custom_values
A named vector containing alternative labels identifying explicit values for fixed nodes (e.g.,
c("A" = "1")).- fixed_sep
A character string indicating which character to use as a separator in fixed nodes. Defaults to
"vlin". Runsep_opts(TRUE)for available options.- sep_point_size
A numerical value specifying the point size for fixed node separators.
Examples
# Provide a DAG object and a list of nodes to be fixed
edges <- c("A -> Y",
"L -> { A Y }")
dag <- qd_dag(edges)
#>
#>
#> CHECKED: The diagram is a DAG.
swig <- dag |>
qd_swig(fixed_nodes = "A",
custom_values = c("A" = "1"))
swig |> DiagrammeR::render_graph()