generate_graph {diffuStats} | R Documentation |
Function generate_graph
generates a random network
using igraph graph generators. Several models are
available, and
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
g <- generate_graph( fun_gen = igraph::barabasi.game, param_gen = list(n = 100, m = 3, directed = FALSE), seed = 1) g ## Not run: plot(g) ## End(Not run)