A Preview of Tableau 8.1 Integration with R Using Parameters (10/8/2013)
Earlier today, Tableau published a post here
by Bora Beran titled Tableau 8.1 and R.
He provided an excellent example of this integration using a very famous data set, a dataset of Iris flowers introduced by Sir Ronald Fisher.
This dataset is often used in data mining classes and text books.
In fact it was the very first assignment in Data Mining I at the University of Cincinnati. Bora's post shows off this exciting new feature that will soon be available in Tableau 8.1.
I am a huge fan of both Tableau and R and have been looking forward to this integration for a long time now.
One major competitor of Tableau, Tibco's Spotfire, allows direct integration with R.
Proctor and Gamble uses Spotfire and I've seen some incredible demonstrations connecting their visual analytics in Spotfire with the model building in R.
As an example, the initial model will run and show a resulting plot. Then the user can select certain observations and the model will immediately re-run using only those observations.
The combination makes for incredible data analysis capabilities an it's a pretty seamless integration. Needless to say, I was eager to check out Tableau's new R integration.
Bora's example outlines how easy it is to connect to R using the R package Rserve.
Once this package is loaded it it possible to connect Tableau to R using one of 4 new functions that are described in the post.
Building on this I wanted to demonstrate the power that is now available in Tableau with this integration.
First, using parameters it is possible to build the variables on the fly and pass them to R.
The variables can be used in the model and the results passed back to Tableau to visualize. The power here is exploratory analysis and "rinse and repeat".
It gives the user the ability to build models with input variables and visualize them quickly. There are packages in R that allow this functionality, for example Shiny.
Shiny is a very powerful package that enables interactive web applications based on input parameters. This is an incredibly powerful feature that Tableau is now able to do.
Second, Tableau's ability to select and highlight points enables a rich analysis on top of the visualization.
For example, after running a cluster analysis it is possible to explore the accuracy of the clusters simply by clicking on the legend or some other feature of the visualization that would highlight the points.
Third, it is now possible to call functions that are not available in Tableau. For example, by using R's basic rnorm() function it is possible to get a pseudo-random number returned back to R, something that is not a native function in Tableau.
Example calculated field:
SCRIPT_REAL("rnorm(1, mean = .5, sd = .2)", count([Number of Records]))
Building on the workbook that Bora posted earlier, below is a screen shot demonstrating a cluster analysis using input parameters.
Click on the image to view full size or download the Tableau 8.1 workbook
Below is an example exploring the accuracy of the clusters simply by clicking on one of them in the legend to highlight on the visualization.
Jeffrey A. Shaffer