Data Viz Done Right

August 16, 2012

Hours in R vs. five clicks in Tableau

9 comments

Matt Katsaros built this really cool map in R of Spotify data.  From Matt: “This is a map of SF showing the % of Spotify listens of [I’m leaving the song unnamed] within each ZIP code.”

When I saw this, I left a comment and told Matt that I could show him how to do this in three clicks with Tableau.  We met today over lunch.

I connected to the data in Tableau, in this case a CSV file, and was presented with this window:

image

Step 1: Double-click on the “zip” dimension and you get this map (NOTE: I zoomed in on the continental US for purposes of this write up):

image

With one click we know where all of the listeners are located.  That’s right, one click!

Step 2: Double-click on the “listens” measure and you get this map:

image

Two clicks and I have an excellent map that shows the concentration of listeners.

Step 3: Drag “listens” onto the color shelf and you get this map:

image

We’re up to three clicks now and now we’ve emphasized the concentration of listeners with both size and color.

Step 4: Matt then wanted to see the map he built of San Francisco, so I lassoed those point and chose the Keep Only option.  I now have this map.  Notice that the colors have adjusted to reflect only the data in the view.

image

Step 5: To change it to a filled map, all I have to do is select the Filled Map option on the Marks card and remove “listens” from the Size shelf.

image

Five mouse clicks to get Matt’s map.  Yes, I know I told him three clicks, but I wanted to show him what Tableau does when you simply click the dimensions and measures.  You could do it in less steps using the Show Me menu.

To say Matt was excited is a huge understatement.  I believe we have a new convert to Tableau.

9 comments :

  1. Excellent Stuff, any idea why the large concentration right of centre?

    ReplyDelete
  2. Matt, this is the Mission district, which is the hipper part of town. Given the song analyzed, it makes sense.

    ReplyDelete
  3. Is it drawing filled maps at the zipcode level? I didn't know geocoding at that level existed out of the box...

    ReplyDelete
  4. I believe he had to go get the shape files and work that into R. Kind of like we used to have to do in Tableau before v7.

    ReplyDelete
  5. Love this. As a former SPSS user I understand his pain...

    ReplyDelete
  6. Nice work! BTW, there's a now active thread on R and Tableau integration where Steven McDaniel asked for feedback at http://community.tableausoftware.com/ideas/1270.

    ReplyDelete
  7. Luv it - Now for devils advocate (key music) @flowingdata showed how you could do a sweet Treemap in 4 lines of code in R (http://flowingdata.com/2010/02/11/an-easy-way-to-make-a-treemap/)
    I used it in a tableau dashboard and imported it as a static image.
    Next step is to incorporate d3.js as a webpage into the dashboard :-) I love lamps and data viz!

    ReplyDelete
  8. How do you make your analysis work reproducible in Tableau? In R you just update your datasource and match the variables. The map you've shown was made in ggplot2 and could be made in no more than 5 minutes not hours.

    ReplyDelete