1 Reply Latest reply on Apr 24, 2018 4:21 PM by Yuriy Fal

    Interpolation/Spline (using R)

    Douglas Sweeney

      This seems really simple but for some reason it doent work;

       

      here is the R script;

       

      x <- c(-50, -25, -12, 0, 12, 25, 50)

      y <- c(1,2,3,4,5,6,7)

      z<- approx(x,y, 5)

      z[2]

       

      output;

      $y

      [1] 4.416667

       

      using Tableau -

      SCRIPT_REAl(

      ' approx(.arg1,.arg2,.arg3)',

      sum([Shock]),

      sum([Value]),

      5)

       

      returns;

      The results returned by the SCRIPT function is of an unexpected type.

       

      the data is a two tabled column with 7 rows....Shock and Value.  Any thoughts?