Vote Compass: visualizing Canadian poll results with R

December 5, 2011

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

Vote Compass is an online "electoral literacy application, whose goal is to encourage engagement with and stimulate discussion around the policy platforms of Canada's political parties. In the lead-up to the 2011 Canadian election, Vote Compass collected the results of an on-line 10-minute survey from more than 2 million participants, and used the results to align voters with the political party that best matched their stated political beliefs. (You can see an overview of the project in this YouTube video.)

Now, the Vote Compass team has used the R programming language to visualize the results of the survey in an attractive poster format. For each question, Gregory Eady and colleagues used the spplot function to draw a Canada-wide (and also city-by-city) choropleth of the results:


Also, the breakdown of the question responses by sub-group are also presented using the ggplot2 package:

Subgroup charts

It's certainly a visually pleasing and interesting way of exploring the results of this survey. One design point: at first, I wasn't sure what to think about using continuous lines for the sub-group charts above, since there were only five possible survey responses. (It seemed a bit odd to interpolate and smooth between "somewhat disagree" and "neither agree not disagree", for example.) But having explored the site a bit, I found these charts surprisingly useful to interpret the results: it's much easier to compare the subgroups with these overlaid "density" charts, than it is using the traditional stacked barchart or similar. And I guess preferences (from "strongly disagree" to "strongly agree") do lie along a continuum, even if only discrete survey responses are allowed.

Anyway, it's nice to see such clarity of vision and attention to detail in the presentation of data like this.

Vote Compass: 2011 Canadian Federal Election

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.


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)