cg_session_set_graph: Change Active Graph

Description Usage Arguments Value Note Author(s) Examples

View source: R/session.R

Description

Set a graph to be the active graph.

Usage

1

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

1
2
3
4
5
6
7
8
# Initialize a computational graph
graph1 <- cg_graph()

# Initialize another computational graph. It becomes the active graph.
graph2 <- cg_graph()

# Set graph1 to be the active graph
cg_session_set_graph(graph1)

cgraph documentation built on Feb. 9, 2020, 5:07 p.m.