Category Archives: current-projects

projects I’m currently working on

ndtv Demo Video & Workshop

Video Demo

I’m experimenting with using a screencast as a way to give tutorials and publicize new features we release as part of the statnet packages. As my first attempt, here is a quick YouTube intro / demo to some of the key features in the ndtv (Network Dynamic Temporal Visualization) package

If you find this format useful, please let me know and maybe I’ll do videos for the full tutorial with more technical explanations. Its definitely a good challenge to talk about things to imaginary people :-)


I’m going to be giving an (obviously much longer) workshop on the ndtv, networkDynamic and tsna packages at the 2016 INSNA ‘Sunbelt’ social networks conference in Newport Beach (Los Angeles) California

Managing Dynamic Network Data in statnet:
Animations, Data Structures and Temporal SNA

Session Time: Tuesday April 5th, 3:00pm-6:00pm
Workshop Program

new ndtv release: 0.7

..and continuing in the thread of long-overdue R package updates, we’ve got a new ndtv version out as well.

Peek into the time prism

The package release adds some “whiteboard candy”: 2.5D orthogonal projection of networks in time along a z axis. For lack of a better name, I’ve dubbed it a timePrism (let me know if you find a pre- existing better name). Think of viewing all of the slices from a filmstrip from an angle. Probably hard to follow for large networks (or lots of time slices) but nice for illustrating concepts in temporal networks when you want to convey time and structure and can accept some loss of detail. Especially with the ability to include splines connecting specific vertices for highlighting trajectories.

           orientation=c('z','y','x'), # swap axes
           spline.v=c(7, 29, 36, 70, 82, 96),  # hilite the infected 
           planes=TRUE,  # draw a semi-transparent 'plane' under each net
           vertex.col='ndtvcol'  # use pre-created infection color scheme)

Continue reading new ndtv release: 0.7

tsna : Tools for Temporal Social Network Analysis

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:

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
# load a dynamic network example
# 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
          layout.par = list(gv.engine='dot')),
    main='earliest fwd path transmission times from vertex 10')


Create in-browser interactive network animations from R with ndtv 0.6.1!

We are releasing an update to the R ndtv package for doing temporal visualizations of dynamic networks. The biggest new feature in this release is the ability to render networks as interactive SVG animations in a web browser with a single command via the ndtv-d3 javascript library (authored by Greg Michalec and myself for statnet) .

By default you can

  • play forwards and backwards, jump to any point in the timeline
  • zoom (mousewheel or pinch)
  • pan (drag)
  • display tooltips (click on a vertex or edge)
  • highlight connections (double-click a vertex)
  • change the playback speed (menu in upper right)

The example above can be produced in your local web browser with the R code below:


Much of it is customizable. If you want to get under the hood, I’ve created a short vignette for ndtv-d3 with additional details on how to configure the the network plot (it generally follows the conventions of and render.animation) and how to include the results rmarkdown documents or export for embedding in a blog post like this one.

There are a number of updates and improvements elsewhere in the package. For example, the proximity.timeline function can now color by vertex attributes.

This image shows a trivial simulated epidemic process on a dynamic network produced by EpiModel. Horizontal splines correspond to the vertices of the network, with red color indicating infection status. The vertical positions are adjust to place closely-connected vertices in proximity, so you can see how the components group and break apart over time. The network snapshots below the timeline illustrate three time points for comparison. See the package vignette for example code.

If you will be at the 2015 INSNA conference, we will be doing a workshop session on Tuesday June 23 with in-depth tutorials of the package.

R package ndtv update + workshop + examples

Finally got the update to the R dynamic network visualization package ndtv 0.5.1 out the door and up on CRAN. This is part of the yearly flurry of statnet package releases (we also posted new versions of network, networkDynamic, ergm, etc, over the last week) in preparation for running workshops at the INSNA Sunbelt social network analysis conference. This year will be a first for me, we will be running a pre-conference ndtv workshop on 2/18/14, so I’ve been working to pull tutorial materials together.

One of the new experimental features in this release is a “proximity.timeline” function, a first stab at doing relationship timelines. The horizontal axis is simulation timesteps and the vertical dimension is geodesic proximity collapsed to 1D. Below is a proximity.timeline plot for the short.stergm.sim example object, showing a changing component with four isolates which eventually breaks into two components around time 20.
Continue reading R package ndtv update + workshop + examples

50 nets of Grey

Just saw this really nice blog post at explaining how to do Exponential Random Graph Modeling (ERGM) using a sexual-hookup network from the TV show Grey’s Anatomy.

Grey's Anatomy sexual-hookup network image

I do some work on some of the dynamics packages in statnet (‘tho not the amazing stats part demoed in the post) so its great to have something to point to explain what the project can do. Now we just need to go back and add the timing information to the edges (who was partnered in which episodes) to be able to estimate the number of concurrent partnerships and look at the epidemic-spreading potential of the network…
(via Brian Keegan)

Talk at TransparencyCamp 2010

The Sunlight Foundation recently brought all of its grantees together so that each organization could learn more about what the others were working on. Since they funded the work on the CorpWatch API, I got to attend. They also invited folks to stay over the weekend and attend the TransparencyCamp, a 2-day “un-conference” in DC for folks interested in getting the government to be more open an responsive with its data.

I gave a presentation on the work we did on the CorpWatch API, and why I think it would be a good idea to develop a common standard id system for company and organization names. The talk was streamed live, and archived as well. I sound a bit jet-lagged ;-)

The slides from the talk are here (pdf).

I really enjoyed the un-conference format: participants basically shout out what they want to present or discuss and convince folks to come to their sessions. Got to finally meet face to face with the people who have been doing all the amazing work to provide the data we use in so many projects. Had some great discussions about trying to build some kind of larger project to create a common id system that various organizations could link to so that companies can be correctly matched and aggregated across datasets. Learned a lot. Was especially interested in some of the work being done internationally, seemed at time more pragmatic, less obsessed with the latest shinny new tech toys.

Digging into’s Bill Endorsement Data

Diagram of bill supportersDan Newman, director of the money in politics watchdog/transparency site kindly shared some of their bill endorsement data for me to explore. In addition to providing an elegant interface for accessing California and U.S. Federal campaign contribution data and voting records, MAPLight’s interns do extensive research to determine various organizations positions on bills that are being voted on in Congress. These endorsement and opposition relationships can be thought of as ties linking the organizations to the various bills they take a position on. The ties can then be assembled to form—yup, you guessed it—networks of bills and their supporters. My hope is that giving the bill data a relational treatment might reveal some of the coalitions and give additional context for each organization’s position.
Continue reading Digging into’s Bill Endorsement Data

San Francisco Political Contributions

Closeup of SF 2008 political contribution networkI’m very interested in trying to figure out ways to map the political landscapes and power structures that are operating around us. I’d like to be able to see various organizations and political actors in the context of their allies, enemies, and supporters in order to understand where the political boundaries are between various factions.
Continue reading San Francisco Political Contributions