Create a network diagram illustrating the simplified module dependencies of a
simulation. Offers a less detailed view of specific objects than does
plotting the depsEdgeList
directly with objectDiagram
.
moduleDiagram(sim, type, showParents, ...) # S4 method for simList,character,logical moduleDiagram(sim, type, showParents, ...) # S4 method for simList,missing,ANY moduleDiagram(sim, type, showParents, ...)
sim | A |
---|---|
type | Character string, either |
showParents | Logical. If TRUE, then any children that are grouped into parent
modules will be grouped together by colored blobs. Internally,
this is calling |
... | Additional arguments passed to plotting function specified by |
Plots module dependency diagram.
igraph
, moduleGraph
for a version that accounts for
parent and children module structure.
Alex Chubaty
if (FALSE) { # Will use quickPlot::Plot moduleDiagram(sim) # Can also use default base::plot modDia <- depsGraph(sim, plot = TRUE) # See ?plot.igraph plot(modDia, layout = layout_as_star) # Or for more control - here, change the label "_INPUT_" to "DATA" edgeList <- depsEdgeList(sim) edgeList <- edgeList[, list(from, to)] edgeList[from == "_INPUT_", from := "Data"] edgeList[to == "_INPUT_", to := "Data"] edgeList <- unique(edgeList) edge ig <- igraph::graph_from_data_frame(edgeList[, list(from, to)]) plot(ig) # Or use qgraph package # library(qgraph) # qgraph(edgeList, shape = "rectangle", vsize = 12, vsize2 = 2 }