delete_edge {DiagrammeR} | R Documentation |
From a graph object of class
dgr_graph
, delete an existing edge by
specifying a pair of node IDs corresponding to the
edge direction.
delete_edge(graph, from, to)
graph |
a graph object of class
|
from |
a node ID from which the edge to be removed is outgoing. |
to |
a node ID to which the edge to be removed is incoming. |
a graph object of class dgr_graph
.
# Create an empty graph graph <- create_graph() # Add two nodes graph <- add_node(graph, node = "a") graph <- add_node(graph, node = "b") # Add an edge graph <- add_edge( graph = graph, from = "a", to = "b") # Delete the edge graph <- delete_edge( graph = graph, from = "a", to = "b")