Description Usage Arguments Value Examples
View source: R/generate_graph.R
Function generate_graph
generates a random network
using igraph graph generators. Several models are
available, and
1 2 3 4 5 6 7 8 | generate_graph(
fun_gen,
param_gen,
class_label = NULL,
class_attr = .default_graph_param(),
fun_curate = .connect_undirected_graph,
seed = NULL
)
|
fun_gen |
function to generate the graphs. Typically from
igraph, like |
param_gen |
list with parameters to pass to |
class_label |
character vector with length equal to
the number of nodes in the graph to generate.
If left to |
class_attr |
data.frame with vertex classes as rownames and a column for each vertex attribute. The name of the column will be used as the attribute name. |
fun_curate |
function to apply to the graph before returning it.
Can be set to |
seed |
numeric, seed for random number generator |
An igraph object
1 2 3 4 5 | g <- generate_graph(
fun_gen = igraph::barabasi.game,
param_gen = list(n = 100, m = 3, directed = FALSE),
seed = 1)
g
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.