cg_session_set_graph {cgraph}R Documentation

Change Active Graph

Description

Set a graph to be the active graph.

Usage

cg_session_set_graph(graph)

Arguments

graph

cg_graph object, the graph that is activated.

Value

none.

Note

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.

Author(s)

Ron Triepels

Examples

# 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)


[Package cgraph version 4.0.3 Index]