Instruction for Using Tableau/R
- In Tableau, create a calculated field.
- In the formula space enter this code: (substituting total sales units for your variable)
- SCRIPT_REAL('ncomp <- scale(.arg1)',sum([Total Sales Units]))
- You will need to start R as a server (see zip file with command and R code; edit the cmd file to point to your version of R).
- Finally, in Tableau under Help->Settings and Performance ->Manager R connection, enter the following:
- Credits go to Benjamin Daniel.