random.graph: Generate A Random Graph/DAG

Description Usage Arguments Examples

View source: R/tools.R

Description

This function allows you to generate a random graph/DAG.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
random.graph(
  nodes,
  exp.degree,
  dag = TRUE,
  plot = TRUE,
  algorithm = c("regular", "watts", "er", "power", "bipartite", "barabasi",
    "geometric"),
  to = "igraph",
  ...
)

Arguments

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').

Examples

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)

rlebron-bioinfo/gnlearn documentation built on July 25, 2020, 12:38 p.m.