Initialize an igraph object for use with causaloptim
Source:R/graph-utilities.R
initialize_graph.Rd
Checks for required attributes and adds defaults if missing
Value
An igraph with the vertex attributes leftside, latent, and nvals, and edge attributes rlconnect and edge.monotone
Examples
b <- igraph::graph_from_literal(X -+ Y)
b2 <- initialize_graph(b)
V(b2)$nvals
#> [1] 2 2