Revisualizing the best cities in the US in 2012- Shiny + googleVis = Incredibly powerful

[This article was first published on Adventures in Analytics and Visualization, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

This is the last time I will talk about visualizing the best cities of 2012 based on Bloomberg Businessweek’s rankings. In an earlier post on this topic, interactive applications to plot bar graphs and histograms for different characteristics defining different cities were discussed. They used R Studio’s shiny server and ggplot2. The reason I am still clinging on to this data is because of how pathetically painful (you can imagine the pain) it was to find out details about the best city in the original article. [This is not uncommon. Rankings published by many media outlets suffer from this problem. I hope someone out there is computing the trade offs between advertising dollars and frustration to customers.] With one city per page, and beginning their discussion with the 50th best city, they actually expected us to go through about 50 pages to find out more about the best city.

What I did was have this data collected and organized into a spreadsheet by a student. I stripped out the textual description of the city and looked at different ways this could be presented. But something was missing there. It, in my opinion, didn’t provide a coherent story. This is my last attempt at doing so, and I try this using the shiny server and the googleVis package. Using them, I bring in interactivity in plotting these cities on a map as well as study how any two characteristics are related to cities and their rankings. (Scatter plots, again, but using googleVis.)If you went through the source code, you’d realize that the ratio of functionality to number of lines of code is incredibly high. Very powerful tools. Please click on the following image to play with the application. The source code link is provided in the application.

To leave a comment for the author, please follow the link and comment on their blog: Adventures in Analytics and Visualization. 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.

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)