2 Replies Latest reply on Jan 9, 2018 6:00 AM by Elizabeth McNair

    R and Tableau: Mann Kendall

    Elizabeth McNair

      I am using R with Tableau and I want to report the results of a Mann Kandell test in Tableau either as a tooltip or label.

       

      I am not able to get the numeric value that is the result in R to show in Tableau.  I keep getting a '1' or '0'.

       

      The result in R is:

       

      tau = -0.448, 2-sided pvalue =< 2.22e-16

       

      Here is the code:

       

      > result<-MannKendall(LIB_complaints$Total_Days)

      > result

      tau = -0.448, 2-sided pvalue =< 2.22e-16

      > as.numeric(result[1])

      [1] -0.4477439

       

      I want to capture the tau value and use it in Tableau.

       

      The calculated field is:

       

      SCRIPT_REAL(

       

      "library(Kendall);

      result <- MannKendall(.arg1);

      as.numeric(result[1])",

      ATTR([Total Days])

       

      )

       

      Instead of seeing the value -0.448, I see 1.

       

      I have also used SCRIPT_INT and I get the same result.

       

      How can I get the actual value from R into Tableau?

       

      I am using Tableau 10.4.0

       

      You will need to run Rserve to see the result in Tableau.