2. Tableau and R
Tableau is a popular Data Visualization tool.
R language is pretty good for statistics and also Data Science
related work.
There are other options apart from R including Python,
Matlab/Octave, SAS.
Focus of this session is on R.
3. What is Used?
Tableau Desktop 10.4
Windows 10
R 3.4.4 executable on windows (64 bit)
(Optional) Rstudio Desktop can also be used along with R
4. SCRIPT_ functions in
Tableau
Tableau provides these functions to integrate with R, Python, MATLAB.
SCRIPT Function and its Purpose
1. SCRIPT_BOOL
Within Tableau executes R, Python or MATLAB code and returns a Boolean value
2. SCRIPT_INT
Returns an `integer
3. SCRIPT_STR
Returns a String
4. SCRIPT_REAL
Returns a Real number i.e. Floating Value
5. Steps to Install and Proceed
1. Install R on Windows.
a. Download R executable from https://cran.r-
project.org/bin/windows/base/
And install is straightforward. Just select default options.
b. Rstudio Desktop is optional download. If you have have it, make
use of R console from R studio desktop.
c. Launch R console and install Rserve package
Install.packages(“Rserve”), library(Rserve), Rserve()
6. 2. Tableau Desktop 10.4
Tableau Desktop has a 14 days trial period. First installed 10.5
version, now can’t use same version again after 14 days.
So for this session showing with Tableau 10.4 (previous version).
All previous releases of Tableau Desktop can be downloaded from
https://www.tableau.com/support/releases
7. 3. Tableau R exercise workbook
Downloaded from https://github.com/raghu-icecraft/tech-
talks/tree/master/Tableau/workbooks
For always latest copy, you can download from Tableau Training
website.
8. 4. Actual integration of R within Tableau.
From the above exercise workbook, let us look usage of R code in
Tableau for a simple math, Outlier detection and K-means
clustering.
All these examples are explained in the Tableau Training website –
R integration.