cg_graph_get: Retrieve Node

Description Usage Arguments Value Note Author(s) Examples

View source: R/graph.R

Description

Retrieve a node from a graph by name.

Usage

1

Arguments

graph

cg_graph object, graph containing the node to be retrieved.

name

character scalar, name of the node to be retrieved.

Value

cg_node object.

Note

In case multiple nodes share the same name, the last node added to the graph is retrieved.

Author(s)

Ron Triepels

Examples

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

# Add an input
a <- cg_input(name = "a")

# Retrieve input a
b <- cg_graph_get(graph, "a")

# Check equality
identical(a, b)

triepels/cgraph documentation built on April 24, 2020, 12:58 a.m.