8 Replies Latest reply on Apr 5, 2016 12:31 PM by Thatchaphon Kaeosuriya

    Can't use tableau with R

    Thatchaphon Kaeosuriya

      I try to practice about R in Tableau(Cluster Analysis) but model can't cluster the data in 4 groups.

      This is the code in calculation field.

       

      SCRIPT_INT(

      "

        set.seed(40);

        result <- kmeans(data.frame(.arg1,.arg2,.arg3,.arg4), 4);

        result$cluster;

      ",

      SUM([Petal.Length]), SUM([Petal.Width]),SUM([Sepal.Length]),SUM([Sepal.Width]))

       

      Here is R code in RStudio

       

      >library(Rserve)

      >run.Rserve()