Saturday 31 March 2018

Integrating R with Tableau

I have earlier used R with MS Power BI, and have decided to try out this R with Tableau. So as the first step I need to integrate it with Tableau.

As the first step I need to install Rserve : install.packages("Rserve")
Rserve is a package which enables applications like Tableau to use R without initializing each time, in other words, it is the connector between Tableau Desktop and R.

I am using RStudio for the ease of my purpose.


And then I run library(Rserve);Rserve() to start Rserve. My R environment is now ready to be used with Tableau.


I am using how_to_integrate_r_and_tableau.twbx downloaded from Tableau site for demonostration purpose.

When I open the 'Regression' worksheet, it shows me an error, it is unable to access the R service.


I am using my localhost as the R service, and I mention that in the External Service Connection.


The default port for R is 6311.


Now my R and Tableau should be integrated. And to test that if I open the 'Regression' worksheet, it works properly this time.


However the next worksheet 'Outlier' throws an error that 'there is no package called mvoutlier'. 


As R is package based, I need to install package mvoutlier.


And now the Outlier report starts working.


Further details and the sample Tableau file can be obtained from Tableau tutorial site.

3 comments:

  1. It was really a nice post Thanks for sharing
    Tableau Online Course

    ReplyDelete
  2. I think there is a need to provide some more information about Tableau and other useful aspects.This is actually the fastest growing data visualisation tool anyway.

    Tableau Rest Api Connection

    ReplyDelete

Implementing & Testing Row Level Security in Power BI

I have suffered a great deal of pain while implementing and more so while validating Row Level Security in Power BI. Let me try to capture a...