add_n_nodes_from_selection {DiagrammeR}R Documentation

Add a multiple of new nodes with edges from one or more selected nodes

Description

Add n new nodes to one or more nodes available in a graph object of class dgr_graph, with edges moving from the nodes in the selection toward the newly created nodes. Optionally, set node type and edge rel values for the new nodes and edges.

Usage

add_n_nodes_from_selection(graph, n, set_node_type = NULL,
  set_edge_rel = NULL)

Arguments

graph

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

n

the number of new nodes to attach as successor nodes to the nodes in the selection.

set_node_type

an optional string to apply a type attribute to all newly created nodes.

set_edge_rel

an optional string to apply a rel attribute to all newly created edges.

Value

a graph object of class dgr_graph.


[Package DiagrammeR version 0.8.2 Index]