cg_input: Add Input

Description Usage Arguments Value Note Author(s) Examples

View source: R/node.R

Description

Add an input node to the active graph.

Usage

1

Arguments

name

character scalar, name of the node (optional). In case argument name is missing, the node is added to the graph under an automatically generated name.

Value

cg_node object.

Note

Inputs cannot be assigned a value upon creation. Instead, they behave as placeholders. You can use data member value of a cg_node object to retrieve or change its value.

Author(s)

Ron Triepels

Examples

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

# Add an input with name 'a' to the graph.
a <- cg_input(name = "a")

# Set the value to 2
a$value <- 2

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

Related to cg_input in cgraph...