simOGraph(n, h = 4, conjunction = TRUE, nparents = 3,
multilevelParent = TRUE, removeDirectIndirect = TRUE, rootName = "Root")
conjunction
is TRUE.
The basic procedure is as follows: nodes (argument n
) are split
into approximately equally sized h
groups, and then each node
from a level is connected to nodes chosen randomly from nodes of the
remaing superior (i.e., closer to the Root) levels. The number of
edges comes from a uniform distribution between 1 and nparents
.
The actual depth of the graph can be smaller than h
because
nodes from a level might be connected to superior levels skipping
intermediate ones.
See the vignette for further discussion about arguments.
(a1 <- simOGraph(10))
library(graph) ## for simple plotting
plot(as(a1, "graphNEL"))
Run the code above in your browser using DataLab