Intro
Tableau Desktop supports integration with R. (Tableau Online/Public don’t support R.)
More info can be found from this whitepaper: Using R and Tableau Software
Basically you need to install Rserve first by the following commands:
install.packages("Rserve") library(Rserve) Rserve()
Then connect Tableau to the R Server. Follow the steps in this video tutorial:
How to integrate R and Tableau
Or this article: How to use R Studio with Tableau
And use R scripts in Tableau’s calculated field. There are four functions:
• SCRIPT_REAL • SCRIPT_STR • SCRIPT_INT • SCRIPT_BOOL
They each return a real number, string, integer, and boolean.
Video tutorial: Bring your R Scripts to Tableau
More examples using R in Tableau
http://www.tableau.com/about/blog/2013/10/tableau-81-and-r-25327
https://www.r-bloggers.com/dream-team-combining-tableau-and-r/
https://boraberan.wordpress.com/