Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
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:
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
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.