Learn R Programming

cgraph (version 6.0.1)

cg_constant: Add Constant

Description

Add a constant node to the active graph.

Usage

cg_constant(value, name = NULL)

Arguments

value

R object, value of the node.

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.

Examples

Run this code
# NOT RUN {
# Initialize a computational graph
graph <- cg_graph()

# Add a constant with value 1 and name 'a' to the graph.
a <- cg_constant(1, name = "a")

# }

Run the code above in your browser using DataLab