Port of qgraph's flow() layout. One node of interest (the
target) is placed alone, then every other node is drawn in successive
levels ordered by unweighted graph distance (BFS hops) from it. This shows
how the target node connects out into the rest of the network.
Arguments
- network
A
CographNetworkorcograph_networkobject.- target
Node of interest, given as a label (character) or 1-based index. When
NULL(default) the highest-degree node is used.- horizontal
Logical. If
TRUE(default) levels flow left to right with the target node on the left; ifFALSEthey flow top to bottom.- equalize
Logical. If
TRUE(default) nodes are evenly spaced within each level.- ...
Additional arguments (ignored).
Details
Unlike qgraph's implementation, weights are binarized for layering (only connectivity matters) and disconnected nodes are placed in an extra trailing level instead of raising an error.
Examples
adj <- matrix(c(0, 1, 1, 0, 1, 0, 0, 1,
1, 0, 0, 0, 0, 1, 0, 0), nrow = 4, byrow = TRUE)
net <- CographNetwork$new(adj)
layout_target(net, target = 1)
#> x y
#> 1 0 0.5000000
#> 2 1 0.3333333
#> 3 1 0.6666667
#> 4 2 0.5000000
