Learn R Programming

cgraph (version 3.0.1)

cg_set: Change the Value of a Node in the Graph

Description

Change the value of node name in the graph.

Arguments

name

character scalar, name of the node that is changed.

value

R object, new value of the node.

Value

nothing.

Details

$set(name, value)

Examples

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

# Add a parameter
a <- x$parm(20, name = "a")

# Change value of a
x$set(a, 40)

# Evaluate a
x$val(a)

# }

Run the code above in your browser using DataLab