delete_edge {DiagrammeR}R Documentation

Delete an edge from an existing graph object

Description

From a graph object of class dgr_graph, delete an existing edge by specifying a pair of node IDs corresponding to the edge direction.

Usage

delete_edge(graph, from, to)

Arguments

graph

a graph object of class dgr_graph that is created using create_graph.

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.

Value

a graph object of class dgr_graph.

Examples

## Not run: 
# 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, from = "a", to = "b")

# Delete the edge
graph <- delete_edge(graph, from = "a", to = "b")

## End(Not run)

[Package DiagrammeR version 0.8.2 Index]