Using ggplot2 to recreate 2012 Best Cities Results

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

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 their blog: Adventures in Analytics and Visualization.

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.

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)