powered by
Add a constant node to the active graph.
cg_constant(value, name = NULL)
R object, value of the node.
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.
name
cg_node object.
# 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