add_n_nodes_to_selection: Add a multiple of new nodes with edges to 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 to the nodes in
the selection from the newly created nodes. Optionally, set node
type
and edge rel
values for the new nodes and edges.
Usage
add_n_nodes_to_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 predecessor 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
.