add_growing_graph {DiagrammeR} | R Documentation |
To an existing graph
object, add a graph built by adding
m
new edges at each time
step (where a node is added).
add_growing_graph(graph, n, m = 1, citation = FALSE, type = NULL, label = TRUE, rel = NULL, node_aes = NULL, edge_aes = NULL, node_data = NULL, edge_data = NULL, set_seed = NULL)
graph |
a graph object of
class |
n |
the number of nodes comprising the generated graph. |
m |
the number of edges added per time step. |
citation |
a logical value
(default is |
type |
an optional string that describes the entity type for all the nodes to be added. |
label |
a boolean value where
setting to |
rel |
an optional string for providing a relationship label to all edges to be added. |
node_aes |
an optional list
of named vectors comprising node
aesthetic attributes. The helper
function |
edge_aes |
an optional list
of named vectors comprising edge
aesthetic attributes. The helper
function |
node_data |
an optional list
of named vectors comprising node
data attributes. The helper
function |
edge_data |
an optional list
of named vectors comprising edge
data attributes. The helper function
|
set_seed |
supplying a
value sets a random seed of the
|
# Create a random, growing # citation graph with 100 # nodes, adding an edge after # each node addition growing_graph <- create_graph() %>% add_growing_graph( n = 100, m = 1, citation = TRUE, set_seed = 23) # Get a count of nodes growing_graph %>% count_nodes() # Get a count of edges growing_graph %>% count_edges()