Create layouts for longitudinal networks.

layout_as_dynamic(gList, weights = NA, alpha = 0.5, iter = 500, tol = 1e-04)

Arguments

gList

list of igraph objects. Each network must contain the same set of nodes.

weights

possibly a numeric vector with edge weights. If this is NULL and the graph has a weight edge attribute, then the attribute is used. If this is NA then no weights are used (even if the graph has a weight attribute). By default, weights are ignored. See details for more.

alpha

weighting of reference layout. See details.

iter

number of iterations during stress optimization

tol

stopping criterion for stress optimization

Value

list of coordinates for each graph

Details

The reference layout is calculated based on the union of all graphs. The parameter alpha controls the influence of the reference layout. For alpha=1, only the reference layout is used and all graphs have the same layout. For alpha=0, the stress layout of each individual graph is used. Values in-between interpolate between the two layouts.

Be careful when using weights. In most cases, the inverse of the edge weights should be used to ensure that the endpoints of an edges with higher weights are closer together (weights=1/E(g)$weight).

References

Brandes, U. and Indlekofer, N. and Mader, M. (2012). Visualization methods for longitudinal social networks and stochastic actor-oriented modeling. Social Networks 34 (3) 291-308

Examples

library(igraph) g1 <- sample_gnp(20,0.2) g2 <- sample_gnp(20,0.2) g3 <- sample_gnp(20,0.2) xy <- layout_as_dynamic(list(g1,g2,g3)) # layout for first network xy[[1]]
#> [,1] [,2] #> [1,] -1.18908019 0.93954788 #> [2,] -0.57571604 -0.68561122 #> [3,] 0.03203296 1.57674614 #> [4,] 0.31540199 0.25693939 #> [5,] 1.39866290 0.59826445 #> [6,] 1.76645308 -0.21891813 #> [7,] 0.46355217 -1.34363338 #> [8,] 0.76633019 -0.65458122 #> [9,] -0.35908370 0.95266354 #> [10,] -0.19220805 -0.53399965 #> [11,] 0.91959581 0.12649354 #> [12,] -1.14745297 -0.41723865 #> [13,] 1.13183792 -0.69762724 #> [14,] 0.13149970 0.43584006 #> [15,] -0.70866476 -0.60368077 #> [16,] -1.45427182 0.34974545 #> [17,] 0.82210295 1.06699783 #> [18,] -0.46362803 -0.07331054 #> [19,] -0.43252457 -1.54362019 #> [20,] -1.38809058 -0.39925831