qd_swig: Generate a single-world intervention graph (SWIG)

View source: R/qd_swig.R

qd_swigR Documentation

Generate a single-world intervention graph (SWIG)

Description

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., a = 1).

fixed.sep

A character string indicating which character to use as a separator in fixed nodes. Defaults to "vlin". Run sep_opts(T) 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)

swig <- dag %>%
        qd_swig(fixed.nodes = "A",
                custom.values = c("A" = "1"))

swig %>% render_graph()


jrgant/quickDAG documentation built on Feb. 15, 2023, 3:20 a.m.