O'Reilly logo

Mastering Tableau by David Baldwin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using R functions

Now that we have successfully connected Tableau with R, let's write some code in Tableau to invoke R. Within Tableau, open the Calculated Field Editor. Notice within the functions panel those entries beginning with SCRIPT_, as shown in the following image:

Using R functions

The SCRIPT functions are used by Tableau to invoke R. The function names communicate the data type of the returned results: SCRIPT_REAL returns float values, SCRIPT_BOOL returns T|F values, and so on.

The syntax of a SCRIPT function is represented in the following diagram:

Using R functions

Exercise ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required