2 Replies Latest reply on Sep 28, 2017 10:41 AM by satish.parvathaneni

    Issue with calling R Density function

    rahul.subramanian

      Hello,

      We are trying to create a simple Tableau Viz in combination with R using Density() function, in order to perform a density estimation.

       

      My Script looks like this:

      X Axis:

      SCRIPT_REAL("a1<-na.omit(.arg1)

      density(a1)$x", ATTR([SRC_COL]))

       

      Y Axis:

      SCRIPT_REAL("a1 <- na.omit(.arg1)

      density(a1)$y", ATTR([Source_Column]))

       

      Depending on filter, Source_Column vector getting passed to R has various lengths. The function returns by default 512 elements/values, and we would like to use it, in order to draw smooth curve.

      Tableau throws the following error.

       

      How to handle this? What am I doing wrong?

       

      Regards,

      Subro