Details on Expression Function


Use the Expression Function dialog to register a function in the Spotfire expression language that is based on Spotfire® Enterprise Runtime for R (a/k/a TERR™). Once an expression function has been created, it is automatically available in the Spotfire expression language.

Tip: If you are developing scripts using Spotfire Enterprise Runtime for R, you can use RStudio, a full-featured, open-source integrated development environment for working with R code. It is provided independently of Cloud Software Group, Inc. You can configure RStudio to use the Spotfire Enterprise Runtime for R engine and to display its language reference. Also, you can access the Spotfire Enterprise Runtime for R language reference at the documentation site.

To reach the Expression Function dialog:

  1. On the menu bar, click Data > Data functions properties, then click the Expression Functions tab.

  2. Click New.

Option

Description

Name

The name of the Expression Function that appears when browsing the function list.

Function type

Specifies whether the new expression function should be a column function or an aggregation function.

Column functions return the same number of rows as the input, whereas an aggregation function aggregates the input values into a single output value.

Description

A description of the function, displayed when browsing the function list (for example, in Custom Expressions or Add Calculated Column dialog).

Return type

The Spotfire data type that the script should return.

Category

The category in the function list in which to place the function, in the Custom Expressions and Add Calculated Column dialogs.

A proper categorization of the functions may make them easier to find when working with them in expressions.

Script

TERR script to use.

For column functions the script should return the same number of rows as the input, whereas for an aggregation function the script should aggregate the input values into a single output value. The output must be placed in a variable called output.

See also:

How to Create an Expression Function