R code for igraph animation

For my personal code archive and everybody who finds interest in it I publish the R code which I used to create the frames for the animations showing the carpoolings formed through the booking system until a certain date. The graphs are created using igraph and plotted into frames which are later glued into an MPEG clip using ffmpeg.


Guidance for the code

The graph and its growth is all contained in one CSV file keeping three columns. A driver’s ID, a passenger’s ID and the the date the passenger took a ride with the driver – according to our booking system – this list defines the possible edges.

Continue reading

Animated visualization of a growing network of carpoolings

Clipboard01As you might know, I am working as the Data Analyst for carpooling.com in Munich. carpooling.com is the company maintaining the leading web platform for organizing carpoolings (in the world, actually). Many people don’t know what “carpooling” means, so let me explain it you:

Tanja lives in Stuttgart and wants to visit her family in Hamburg next weekend. This is quite a long distance and hence pretty expensive – and also kind of dull sitting in a car alone for several hours. Having three free seats in her car left, she thinks to herself … “Why not offer those seats to other people and share the expenses with them?!”. So she advertises her planned lift on www.mitfahrgelegenheit.de – the biggest German web-site for carpoolings. Peter who also wants to travel to Hamburg next weekend finds her ad and gives her a call to seal the deal. Okay, so far so good, but few passengers aren’t as reliable as Peter and might just forget about the ride and Tanja would then be left with a free seat and no money. So carpooling.com came up with the idea of a “booking system” to make carpooling agreements more binding. Next weekend Tanja, Peter and further passengers meet and drive to Hamburg together.

Continue reading