We finally got the alpha release of the new tsna package up on CRAN! The goal is for the package to be a repository of algorithms and techniques for doing Social Network Analysis on longitudinal networks stored as networkDynamic objects. It includes:
- Code for finding forward temporal paths through networks which will hopefully serve as the basis of lots of extensions of centrality measures.
- Tools for evaluating durations of ties, rates of change, etc
- Measures of sequence (Gibson’s p-shifts) from the relevent package
- Static projections of dynamic networks
- And of course it has wrappers for evaluating standard ‘static’ SNA metrics at multiple time points and returning a time series (using the ergm and sna packages).
The package vignette has lots more details.
As a quick example, the code below extracts a forward temporal path (think “what is the earliest journey a message could take from vertex 10 to each vertex in the network while respecting edge timing”) and plots it as a transmission tree, including the transmission time for each edge:
# load the libraries library(tsna) library(ndtv) # load a dynamic network example data("moodyContactSim") # compute the forward temporal path from vertex 10 at time 0 v10path< -tPath(moodyContactSim,10) # plotting trees still a little complicated, # but with Graphviz and ndtv we can do it plot(v10path, coord=network.layout.animate.Graphviz(as.network(v10path), layout.par = list(gv.engine='dot')), edge.label.col='blue', main='earliest fwd path transmission times from vertex 10')
One thought on “tsna : Tools for Temporal Social Network Analysis”