Learn R Programming

DiagrammeR (version 0.8.2)

delete_node: Delete a node from an existing graph object

Description

From a graph object of class dgr_graph, delete an existing node by specifying its node ID.

Usage

delete_node(graph, node)

Arguments

graph
a graph object of class dgr_graph that is created using create_graph.
node
a node ID for the node to be deleted from the graph.

Value

a graph object of class dgr_graph.

Examples

Run this code
## Not run: 
# # Create an empty graph
# graph <- create_graph()
# 
# # Add two nodes
# graph <- add_node(graph, node = "a")
# graph <- add_node(graph, node = "b")
# 
# # Delete a node
# graph <- delete_node(graph, node = "a")
# ## End(Not run)

Run the code above in your browser using DataLab