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,]  0.63499545 -1.60105275
#>  [2,]  1.31912197  1.39604692
#>  [3,] -0.49840208  0.90572748
#>  [4,]  0.40380703  1.46454610
#>  [5,]  1.39873029 -0.92957223
#>  [6,] -0.96413636 -0.48972103
#>  [7,]  0.41649872  0.98732712
#>  [8,] -0.71376482 -1.03436710
#>  [9,]  0.24627933  0.15937700
#> [10,] -1.57192694  0.70869851
#> [11,]  1.89540482 -0.22159264
#> [12,] -0.05346289  1.22831217
#> [13,]  0.48313228  0.26443266
#> [14,] -0.18743568  1.94941667
#> [15,] -0.19762508 -0.18296778
#> [16,]  0.41693329 -1.00725754
#> [17,] -0.07786289 -2.42286599
#> [18,]  0.54943299 -0.70412002
#> [19,] -1.95510118 -0.08965390
#> [20,] -0.64773866 -0.01406314