View source: R/layout-target-saqr.R
| layout_target | R Documentation |
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.
layout_target(network, target = NULL, horizontal = TRUE, equalize = TRUE, ...)
network |
A |
target |
Node of interest, given as a label (character) or 1-based
index. When |
horizontal |
Logical. If |
equalize |
Logical. If |
... |
Additional arguments (ignored). |
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.
Data frame with x, y coordinates, one row per node.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.