Why are we wrapping up with R? When you are proudly showing off your data, your audience may include a statistician or a data scientist who wants to take your data away and conduct further analysis. When you are showing off dashboards, it is important to be mindful that you are showing data to an audience with a variety of skills and perspectives. This may include people who need detailed data as well as the business user or strategy decision maker who needs the headline first.
This topic has been included to acknowledge the data scientists and the statisticians in your organization. These individuals may be self-taught or have strong academic backgrounds in this topic. Your dashboards in Tableau can also reach these people, and they can further deepen their investigation by using R.
After all, the dashboard is like a tool for the data scientist as well as the business decision maker. How is your dashboard like a tool? Tableau is fantastic as a prototyping tool, because it can help you create dashboards quickly without well-defined user specifications. This means that your dashboard can grow very organically. Including R allows you to conduct advanced analytics based on your organic dashboards, thereby offering further insights.
Fortunately, Tableau allows you to use R, a functional programming language, plus an environment to study statistics and data science. R has over 5,000 packages in existence, and the range is growing continuously.
This exciting development means that you can use R packages and functions in Tableau's calculated fields, thereby unlocking all of the features of R when creating Tableau charts. For instance, you will be able to use results of R functions to annotate points on a chart, thereby adding context to the data. You can also use the result of R's statistical functions as a source for Tableau charts.
For example, you can color points by cluster using the k-means
clustering function that is available in R. Since the output of R can be used, business analysts will see the results directly in Tableau without the need to know the R language themselves. This truly unleashes the power of R!
In this recipe, we will look at connecting Tableau to R.
Note that R integration is not supported by Tableau Reader or Tableau Online.
For the exercises in this recipe, we will build on the existing Chapter Eight
dashboard in order to access R.
You will also need to have Internet access in order to install R and Rserve. You will also install RStudio, which is a user-friendly way to use R.
Note that this functionality is only available in Version 8.1 or above.
R-3.0.3-win.exe
. Double-click on the file, and follow the wizard..exe
file. Click on Run.Rserve
, as shown in the following screenshot:Rserve()
in the console.The process starts an R package called Rserve, which uses TCP/IP to serve the connection that allows other programs to use the facilities of R. Rserve has a number of advantages; it is quick because it does not initialize R as part of its startup. It is also cleverly programmed so that each connection has its own working directory, and consequently, each connection does not have an impact on the other connections.
In this recipe, we used RStudio to install Rserve. Tableau offers another way of installing Rserve on their knowledge base, and you can find more information on this at http://kb.tableausoftware.com/articles/knowledgebase/r-implementation-notes.
This easy connection brings all of R's data analysis capabilities to Tableau. You can view Tableau as the shop window that makes data visible and accessible to users. R does the hard data analysis behind the scenes.
This means that users can bring the power of R's amazing statistical capabilities to data visualizations in Tableau. Very powerful indeed! Oh, and fun!
If you want to know more about R, please visit the R website at http://www.r-project.org/. Oh, and be warned; prepare to lose a lot of time totally engrossed in R, Tableau, and data. Data will change your life! Have fun with it, and embrace your inner data love.