cg_session_set_graph {cgraph} | R Documentation |
Set a graph to be the active graph.
cg_session_set_graph(graph)
graph |
cg_graph object, the graph that is activated. |
none.
Any nodes that are created are automatically added to the active graph. This also applies to operations that are created by overloaded S3 functions that do not follow the cg_<name> naming convention (such as primitive inflix functions '+' and '-').
Only one graph can be active at a time. The active graph can be changed by calling this function on another cg_graph object.
Ron Triepels
# Initialize a computational graph x <- cg_graph() # Initialize another computational graph. It becomes the active graph. y <- cg_graph() # Set x to be the active graph cg_session_set_graph(x)