Learn R Programming

ndtv (version 0.13.4)

compute.animation: Compute a sequence of vertex layouts over time suitable for rendering an animation.

Description

Steps through a networkDynamic object and applies layout algorithms at specified intervals, storing the calculated coordinates in the network for later use by the render.animation function. Generally the layout are done in a sequence with each using the previously calculated positions as initial seed coordinates in order to smooth out the resulting movie. Not all network layout algorithms give good results.

Usage

compute.animation(net, slice.par = NULL, animation.mode = "kamadakawai", 
                  seed.coords = NULL, layout.par = list(), 
                  default.dist = NULL, weight.attr = NULL, weight.dist=FALSE,
                  chain.direction=c('forward','reverse'),
                  verbose = TRUE,...)

Value

Invisibly returns original network argument (which is also modified in-place), with the addition of a network variable slice.par storing the slice parameters used, and dynamic node attributes animation.x and animation.y storing the coordinates calculated for each time point.

Arguments

net

A networkDynamic network object describing the temporal evolution of a network.

slice.par

A list of parameters which specify the time steps and aggregation that should be used when moving through the network. Example: slice.par=list(start=0,end=100,interval=1, aggregate.dur=1,rule='latest')

The parameters are:

  • start The time point at which the sequence of layouts should begin

  • end The time point at which the sequence of layouts should finish

  • interval The amount of time between successive layouts

  • aggregate.dur The duration of time over which the network should be aggregated to derive the network for each layout

  • rule The aggregation rule to be used when collapsing the network.

animation.mode

The name of the network animation layout to be used. These layouts are name network.layout.animate.something but will be matched using the final part of the name. Current useful values are:

  • network.layout.animate.kamadakawai essentially wrapper for the Kamadakawai layout included in the network package.

  • network.layout.animate.MDSJ a wrapper to do a Stress Majorization optimized MDS layout using the Multi Dimensional Scaling for Java package. Note, due to license restrictions, this algorithm is for non-commercial use only)

  • network.layout.animate.useAttribute applies coordinates stored in a user-generated dynamic network attribute

  • network.layout.animate.Graphviz a wrapper for the Graphviz software library --if the library is installed on your system.

seed.coords

(optional) an array of initial positions to be used for the very first layout in the sequence

layout.par

A list of parameters to be passed to the layout algorithm.

default.dist

The default distance to be used to separate nodes (or disconnected network components). Default to sqrt(network.size(net)). See layout.distance.

weight.attr

charater providing the name of a (possibly dynamic) numeric edge attribute defining weights for the edges in each time slice. The values activity.duration or activity.count can be used to weight edges by the duration or count of the edge's activity spells in the time slice.

weight.dist

logical, defaults to FALSE, meaning that the edge weight values provided by weight.attr will be treated as similarities (larger values means closer). A value of TRUE means that weights should be intrepreted as distances. See layout.distance for more information.

chain.direction

a value of 'forward' indicates the chain of layouts should be computes in forward temporal order. A value 'reverse' runs the chain backwards. For some layouts, reverse-chaining means that isolated vertices are more likely to have positions close to the partners they will be tied to.

verbose

If true, additional information about the layout process and progress will be returned to console.

...

possible additional arguments to be passed to sub processes

Author

Skye Bender-deMoll, and the statnet team.

Details

This function is under active development so implementation and parameters will continue to change.

References

See docs for specific layout functions.

Bender-deMoll, S., Morris, M. and Moody, J. (2008) Prototype Packages for Managing and Animating Longitudinal Network Data: dynamicnetwork and rSoNIA Journal of Statistical Software 24:7.

Krivitsky P and Handcock M (2012). Fit, Simulate and Diagnose Models for Network Evoluation based on Exponential-Family Random Graph Models. Version 3.0-999. Project home page at https://statnet.org, https://cran.r-project.org/package=tergm.

Butts CT (2008). network: A Package for Managing Relational Data in R. Journal of Statistical Software, 24(2). tools:::Rd_expr_doi("10.18637/jss.v024.i02").

Skye Bender-deMoll and McFarland, Daniel A. (2006) The Art and Science of Dynamic Network Visualization. Journal of Social Structure. Volume 7, Number 2 https://www.cmu.edu/joss/content/articles/volume7/deMollMcFarland/

See Also

See also layout.distance, render.animation, network.layout.animate.MDSJ,ndtv, package vignette (vignette('ndtv')) for examples.