dag_edge {causact} | R Documentation |
Add edge (or edges) between nodes
Description
With a graph object of class causact_graph
created from dag_create
, add an edge between nodes in the graph. Vector recycling is used for all arguments.
Usage
dag_edge(graph, from, to, type = as.character(NA))
Arguments
graph |
a graph object of class |
from |
a character vector representing the parent nodes label or description from which the edge is connected. |
to |
the child node label or description from which the edge is connected. |
type |
character string used to represent the DiagrammeR line type (e.g. |
Value
a graph object of class dgr_graph
with additional edges created by this function.
Examples
# Create a graph with 2 connected nodes
dag_create() %>%
dag_node("X") %>%
dag_node("Y") %>%
dag_edge(from = "X", to = "Y") %>%
dag_render(shortLabel = TRUE)
[Package causact version 0.5.5 Index]