Jump to content
  • TIBCO Spotfire User Group Tips & Tricks: Create you own functions using TERR & R


     

    Create you own functions using TERR & R

    Data functions that call the TIBCO Enterprise Runtime for R engine can now be configured to aggregate data. In the image below, a new expression function has been created using the new Function type "Aggregation function":

     

    define_custom_terr_function(1).gif.f10cef1270823a44dce74d98b8ab3308.gif

     

     

    In the example above the function FahrenheitToCelcius is defined using the code below:

     

     

    #Define the FahrenheitToCelcius function
    FahrenheitToCelcius <- function(TempCelcius)
    {
     TempFahrenheit <- TempCelcius *(9/5) + 32
     TempFahrenheit
    }
     

     

    #Run the function to produce the output
    output <- FahrenheitToCelcius(TempCelcius = input1)
     

    Once defined, the function can be used to add a "normal" calculated column.

    use_customised_terr_function_0(1).gif.30a10394f7aa911f73df99435addcea2.gif


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...