11 Replies Latest reply on Apr 14, 2015 10:25 AM by Todd Petersen

    [Workbook attached] Unable to replicate outlier R & Tableau example from Bora Beran with own dataset.

    Michel Cavas

      What I am trying to do here, is to replicate the example in the first video here: Tableau 8.1 and R | Tableau Software.

      My dataset is the monthly temperatures for Paris from jan 1757 until oct 1990, there is only a date dimension 'Month' and a temperature measure 'Temp_Month' in this set. Temp_Month is aggregated to AVG.


      This is the formula Bora Beran uses for R: IF SCRIPT_REAL("library(mvoutlier);sign2(cbind(.arg1))$wfinal01", AVG([Flow CFS])) == 0 THEN "Outlier" ELSE "OK" END


      I have adjusted this, to include my Temp_Month measure, to: IF SCRIPT_REAL("library(mvoutlier);sign2(cbind(.arg1))$wfinal01",AVG([Temp_Month])) == 0 THEN "Outlier" ELSE "Normal" END


      I also tried to the adjusted formula used in the video: R Integration | Tableau Software :




          AVG([Temp_Month])) = 0

      THEN "Outlier"

      ELSE "Normal"



      The connection to R is working, see image R connection.jpg.


      The error I am getting as soon as i drag my calculated measure "Outlier" to the marks tab is: "An error occurred while communicating with the Rserve service." and under details: "Error in svd(xs) : infinite or missing values in 'x' "


      I have tried looking up what I can do about this error, but can't seem to find the solution to this.


      What I would like to do, is to determine temperature outliers per month (using a filter).


      'Timeseries Paris Temperature.twbx' workbook attached.


      I am still a novice to R, currently am halfway through the book "R for dummies".

      Any help in this matter would be greatly appreciated!



      Edit: Additional comment: Replicating the example with the Superstore Subset (Excel) is working, so I am assuming this proves my connection with R is actually working? However still can't get it to work with my own dataset.