Description Usage Arguments Examples
This function allows you to generate a random graph/DAG.
1 2 3 4 5 6 7 8 9 10 |
nodes |
Number of nodes or vector of node names. |
exp.degree |
Number of expected degree per node. |
dag |
Whether the graph should be a DAG or not. Default: TRUE |
plot |
Whether or not to plot the graph. Default: TRUE |
algorithm |
Algorithm to be used to generate the graph: 'regular', 'watts', 'er', 'power', 'bipartite', 'barabasi', or 'geometric'. Default: 'regular' |
to |
Output format ('adjacency', 'edges', 'graph', 'igraph', or 'bnlearn'). |
1 2 3 4 | graph <- random.graph(LETTERS[1:15], 3, dag=TRUE)
graph <- random.graph(LETTERS[1:15], 3, dag=FALSE)
graph <- random.graph(15, 3, dag=TRUE)
graph <- random.graph(15, 3, dag=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.