I see this post has not been replied to and wanted to check in with you to see if you have found a solution or if assistance is still needed. My reply here will bring this back to the top of the list of the recent posts in this group.
Also note that I have removed the direct call outs for assistance. We typically try to see if there are other members of the community that may assist before calling out a specific member of the community.
Although this should be possible with R integration, is there a reason not to use Tableau's native standard deviation and correlation functions? These might accomplish the task a little more easily?
Regarding your calculations, the syntax should look like this:
SCRIPT_REAL("cor(.arg1, arg1)",MAX([Performance]), MAX([Performance]))
- for this function, you will need to create a view that either filters or slices the data with the dimensions of Fund and Indicator.
For more information on Tableau's R integration please read the following: