Learn R Programming

cgraph (version 6.0.1)

cg_graph_get: Retrieve Node

Description

Retrieve a node from a graph by name.

Usage

cg_graph_get(graph, name)

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.

Examples

Run this code
# NOT RUN {
# 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)

# }

Run the code above in your browser using DataLab