0 Replies Latest reply on Dec 19, 2018 12:29 PM by April Darby

    R Performance Issue

    April Darby

      I'm creating a workbook with 6 different binomial distributions. Unfortunately, this isn't in Tableau so I used R. It's a complicated workbook with a ton of data so it's already somewhat slow. When I added the 6 different R calculations it became very slow. In my attempt to speed up performance I found this on the tableau website.

       

      Tableau and R Integration

      *** The workaround is to concatenate the output of the R script into a single value, then use multiple measures in Tableau to parse that out. Depending on the R script and number of calls & time to process, that might be faster. For example, the Poisson distribution functions from the epicalc library return 4 values at once (low & high tails for .0005 and .025) as an array, it might be faster/easier to make a single call to R return something like “.01,.02,.98,.99″ for a given row in the partition and then use 4 separate calcs to parse that out, rather than have 4 separate SCRIPT_*() functions.

       

      So I created this calculated field to concatenate 2 of my equations for testing purposes. This R script works seamlessly in R.  (Keep in mind I have l year of tableau experience and 1 month of R, so I'm new to both.)

      I can't get the data to parse out into two separate fields as mentioned above. I even tried to make it a string then split it, no luck. None of the googled answers worked; right click on the calculated field - split, right click in the data source column - split, custom split, or a split calculation. All either aren't available or give an error.

       

      I'm using Tableau 2018.3. Any help would be very appreciated!