Learn R Programming

causact (version 0.5.7)

dag_edge: Add edge (or edges) between nodes

Description

[Stable]

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))

Value

a graph object of class dgr_graph with additional edges created by this function.

Arguments

graph

a graph object of class causact_graph.

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. "solid"). Use type = "extract" to encourage causact to only pass indexed elements of the parent node to each instance of the child node. Specify type = "solid" to override any automated extract behavior.

Examples

Run this code
# 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)

Run the code above in your browser using DataLab