dag_edge {causact}R Documentation

Add an edge (or edges) between nodes in a graph object.

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

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.4.0 Index]