create_random_graph {DiagrammeR}R Documentation

Create a randomized graph

Description

Create a graph of up to n nodes with randomized edge assignments.

Usage

create_random_graph(n, m, directed = TRUE, graph_name = NULL,
  display_labels = TRUE, set_seed = NULL, write_backups = FALSE)

Arguments

n

the number of nodes to use in the random graph.

m

the number of edges to use in the random graph.

directed

an option for whether the random graph should be undirected (default) or directed.

graph_name

an optional string for labeling the graph object.

display_labels

display node labels.

set_seed

supplying a value sets a random seed of the Mersenne-Twister implementation.

write_backups

an option to write incremental backups of changing graph states to disk. If TRUE, a subdirectory of the working directory will be used to store RDS files. The default value is FALSE so one has to opt in to use this functionality.

Examples

# Create a random, directed graph with 50 nodes
# and 75 edges
random_graph_directed <-
  create_random_graph(
    n = 50, m = 75)

[Package DiagrammeR version 0.9.2 Index]