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

June 23, 2013

(This article was first published on Adventures in Analytics and Visualization, and kindly contributed to R-bloggers)

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 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...

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)