Watch Obama and Romney criss-cross the US

November 1, 2012

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

The Washington Post has an interactive graphic showing the rate at which the US presidential candidates Barack Obama and Mitt Romney have visited the various states for campaign rallies and fundraisers. Here's how it looks today:

Washington post campaign stops

You can clearly see the focus on key swing states like Florida and Ohio, as well as non-competitive (but donor-rich) states like California and Texas. But this aggregate view doesn't give a sense of the sheer logistics of the candidates (plus their entourages and press pool) travelling across the country from event to event. 

So statistician Jerzy Wieczorekm used data on the invididual campaign stops and dates to create this animated visualization of Obama's and Romney's itineraries over the past few months:

Now that's a hectic travel schedule! And that's not even all the travel: this animation shows only the campaign stops, not other trips unrelated to the campaign (such as returning to Washington DC for the President, or Romney returning to his Boston HQ). It's a bit of a shame they're not collecting frequent flyer miles in the process.

Jerzy used the R language to create the animation. This involved extracting the campaign stops in JSON format, geocoding the campaign stop locations into latitudes and longitudes (for mapping), and breaking down each day into 24 one-hour blocks so the animation runs smoothly in accelerated time. He then used the code behind this historic shipping animation to create the video above. R programmers can find all the technical details at Jerzy's blog post, linked below.

Civil Statistician: Animated map of 2012 US election campaigning, with R and ffmpeg 


To leave a comment for the author, please follow the link and comment on their blog: Revolutions. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , ,

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)