Learn R Programming

cgraph (version 3.0.1)

cg_const: Add Constant

Description

Add a constant node to the graph.

Arguments

value

numeric vector or array, value of the node (optional).

name

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

Value

cg_node, constant.

Details

$const(value = NULL, name = NULL)

Examples

Run this code
# NOT RUN {
# Initialize a new computational graph.
x <- cgraph$new()

# Add a constant with value 1 and name 'c' to the graph.
x$const(1, name = "c")

# }

Run the code above in your browser using DataLab