Jump to content
  • How to add R functions into Spotfire expression language in Spotfire® Using IronPython Scripting


    This article explains how to add R functions into Spotfire expression language in Spotfire® Using IronPython Scripting

    Introduction

    Use the DataFunctionExpressionFunction to register a function in the Spotfire expression language (is based on TIBCO Enterprise Runtime for R). Once an expression function has been created, it is available in the Spotfire expression language.

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    import Spotfire.Dxp.Data.DataFunctions.DataFunctionExpressionFunction as df
    import Spotfire.Dxp.Data.DataType as dt
    
    func = df.CreateTERRExpressionFunction(
        "output<-input1*2",
        "DoubleInput",
        "Doubles the input",
        "Math functions",
        dt.Real
    )
    
    Document.Data.ExpressionFunctions.Add(func)
     

    References

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...