Exogenize a graph by removing all ingoing edges to the set of nodes
specified (i.e., make the nodes exogenous), as well as joining the
parents of the nodes specified to the children of the nodes specified.
Arguments
- cg
A caugi object of class "DAG".
- nodes
A character vector of node names to exogenize. Must be a subset
of the nodes in the graph.
Value
A caugi object representing the exogenized graph.
Examples
cg <- caugi(A %-->% B, class = "DAG")
exogenize(cg, nodes = "B") # A, B
#> <caugi object; 2 nodes, 0 edges; simple: TRUE; session=0x555e33393170>
#> graph_class: DAG
#> nodes: A, B
#> edges: (none)