Using ggplot2 to recreate 2012 Best Cities Results

April 18, 2013
By

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

Data from: http://images.businessweek.com/slideshows/2012-09-26/americas-50-best-cities
This time, I used ggplot2 to recreate the graphs created previously using Tableau. After all, R and ggplot2 are open source and free. Yes, I could leave a space between bars for different cities, but I wanted to be as close as possible to the tableau graphs previously generated. Yes, these are bar graphs for different cities, in contrast to area graphs generated by tableau. I tried area graphs with ggplot2 and although it was relatively simple to create them with "Rank of city" as a continuous var, it was much simpler to use bar graphs if I had to display the names of city on the axes (instead of just ranks).
First set of vars


Second set of vars

Third set of vars




To leave a comment for the author, please follow the link and comment on his blog: Adventures in Analytics and Visualization.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: 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.