add_edge {DiagrammeR} | R Documentation |
With a graph object of class dgr_graph
, add an edge
to nodes within the graph.
add_edge(graph, from, to, rel = NULL)
graph |
a graph object of class |
from |
the outgoing node from which the edge is connected. |
to |
the incoming nodes to which each edge is connected. |
rel |
an optional string specifying the relationship between the connected nodes. |
a graph object of class dgr_graph
.
## Not run: # Create a graph with two nodes graph <- create_graph(create_nodes(nodes = c("a", "b"))) # Add an edge between those nodes and attach a relationship to the edge graph <- add_edge(graph, from = "a", to = "b", rel = "to_get") ## End(Not run)