Built-In TERR Expression Functions in Spotfire
In the Spotfire Custom Expressions or Insert Calculated Column dialog box, from the Function list, you can select one of the built-in TERR expression functions provided for advanced statistical analysis.
Each function invokes the TERR engine. The results depend on the expression function you select.
- For nonaggregated functions,
the
TERR
script should set the variable
output
to a vector or a one-column data frame, which is the same length as the input column(s), of the specified TERR data type. Spotfire converts the data type to the corresponding Spotfire data type. - For aggregated functions,
the
TERR
script should set the variable
output
to a scalar value of the specified TERR data type, which Spotfire converts to the corresponding Spotfire data type. The TERR script is called once for each group of data to be aggregated. No special handling for aggregation is necessary in your TERR script.
Expression function component | Description | Example |
---|---|---|
TERR_<SpotfireDataType>
or
TERRAggregation_<SpotfireDataType>
|
The built-in expression function. |
The
TERR
returned value (specified by
|
input1 ,
input2 ,
input3 ...
inputN
|
Each input
(inputN ) is a parameter that is passed in
to the
TERR
expression function, and that corresponds to a column name (Colname) in the
same numerical order.
The column names corresponding to the inputs are added as the last component of the expression, immediately after the calculation's closing quotation marks and comma, and immediately before the closing parenthesis. Each column name is enclosed in square brackets. Column names are separated by commas. |
The calculation specifies that, for each row, the value in the
column
|
output
|
The returned value of the calculation in TERR. It can be added to the Spotfire visualization as a column or a single aggregated value. |
|
Select one of the topics for the available built-in expression functions to learn more.
- TERR_Binary
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERR_Binary
from the Function list. This expression function invokes the TERR engine to return a vector or a single column data frame of the data typeraw
, which is converted to a Spotfire column of the corresponding Spotfire data type Binary. - TERR_Boolean
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERR_Boolean
from the Function list. This expression function invokes the TERR engine to return a vector or a single column data frame of the data typelogical
(TRUE
orFALSE
), which is converted to a Spotfire column of the corresponding Spotfire data type Boolean. - TERR_DateTime
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERR_DateTime
from the Function list. This expression function invokes the TERR engine to return a vector or a single column data frame of the data typePOSIXct
orPOSIXlt
, which is converted to a Spotfire column of the corresponding Spotfire data type DateTime. - TERR_Integer
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERR_Integer
from the Function list. This expression function invokes the TERR engine to return a vector or a single column data frame of the data typeinteger
, which is converted to a Spotfire column of the corresponding Spotfire data type Integer. - TERR_Real
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERR_Real
from the Function list. This expression function invokes the TERR engine to return a vector or a single column data frame of the data typenumeric
, which is converted to a Spotfire column of the corresponding Spotfire data type Real. - TERR_String
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERR_String
from the Function list. This expression function invokes the TERR engine to return a vector or a single column data frame of the data typecharacter
, which is converted to a Spotfire column of the corresponding Spotfire data type String data type. - TERR_TimeSpan
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERR_TimeSpan
from the Function list. This expression function invokes the TERR engine to return a vector or a single column data frame of the data typedifftime
, which is converted to a Spotfire column of the corresponding Spotfire data type TimeSpan. - TERRAggregation_Binary
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERRAggregation_Binary
from the Function list. This expression function sets the variableoutput
to a scalar value of the TERR data typeraw
, which Spotfire converts to the corresponding Spotfire data type Binary. The TERR script is called once for each group of data to be aggregated. No special handling for aggregation is necessary in your TERR script. - TERRAggregation_Boolean
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERRAggregation_Boolean
from the Function list. This expression function sets the variableoutput
to a scalar value of the TERR data typelogical
(TRUE
orFALSE
), which Spotfire converts to the corresponding Spotfire data type Boolean. The TERR script is called once for each group of data to be aggregated. No special handling for aggregation is necessary in your TERR script. - TERRAggregation_DateTime
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERRAggregation_DateTime
from the Function list. This expression function sets the variableoutput
to a scalar value of the TERR data typePOSIXct
orPOSIXlt
, which Spotfire converts to the corresponding Spotfire data type DateTime. The TERR script is called once for each group of data to be aggregated. No special handling for aggregation is necessary in your TERR script. - TERRAggregation_Integer
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERRAggregation_Integer
from the Function list. This expression function sets the variableoutput
to a scalar value of the TERR data typeinteger
, which Spotfire converts to the corresponding Spotfire data type Integer. The TERR script is called once for each group of data to be aggregated. No special handling for aggregation is necessary in your TERR script. - TERRAggregation_Real
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERRAggregation_Real
from the Function list. This expression function sets the variableoutput
to a scalar value of the TERR data typenumeric
, which Spotfire converts to the corresponding Spotfire data type Real. The TERR script is called once for each group of data to be aggregated. No special handling for aggregation is necessary in your TERR script. - TERRAggregation_String
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERRAggregation_String
from the Function list. This expression function sets the variableoutput
to a scalar value of the TERR data typecharacter
, which Spotfire converts to the corresponding Spotfire data type String. The TERR script is called once for each group of data to be aggregated. No special handling for aggregation is necessary in your TERR script. - TERRAggregation_TimeSpan
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERRAggregation_TimeSpan
from the Function list. This expression function sets the variableoutput
to a scalar value of the TERR data typedifftime
, which Spotfire converts to the corresponding Spotfire data type TimeSpan. The TERR script is called once for each group of data to be aggregated. No special handling for aggregation is necessary in your TERR script.
- TERR_Binary
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERR_Binary
from the Function list. This expression function invokes the TERR engine to return a vector or a single column data frame of the data typeraw
, which is converted to a Spotfire column of the corresponding Spotfire data type Binary. - TERR_Boolean
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERR_Boolean
from the Function list. This expression function invokes the TERR engine to return a vector or a single column data frame of the data typelogical
(TRUE
orFALSE
), which is converted to a Spotfire column of the corresponding Spotfire data type Boolean. - TERR_DateTime
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERR_DateTime
from the Function list. This expression function invokes the TERR engine to return a vector or a single column data frame of the data typePOSIXct
orPOSIXlt
, which is converted to a Spotfire column of the corresponding Spotfire data type DateTime. - TERR_Integer
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERR_Integer
from the Function list. This expression function invokes the TERR engine to return a vector or a single column data frame of the data typeinteger
, which is converted to a Spotfire column of the corresponding Spotfire data type Integer. - TERR_Real
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERR_Real
from the Function list. This expression function invokes the TERR engine to return a vector or a single column data frame of the data typenumeric
, which is converted to a Spotfire column of the corresponding Spotfire data type Real. - TERR_String
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERR_String
from the Function list. This expression function invokes the TERR engine to return a vector or a single column data frame of the data typecharacter
, which is converted to a Spotfire column of the corresponding Spotfire data type String data type. - TERR_TimeSpan
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERR_TimeSpan
from the Function list. This expression function invokes the TERR engine to return a vector or a single column data frame of the data typedifftime
, which is converted to a Spotfire column of the corresponding Spotfire data type TimeSpan. - TERRAggregation_Binary
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERRAggregation_Binary
from the Function list. This expression function sets the variableoutput
to a scalar value of the TERR data typeraw
, which Spotfire converts to the corresponding Spotfire data type Binary. The TERR script is called once for each group of data to be aggregated. No special handling for aggregation is necessary in your TERR script. - TERRAggregation_Boolean
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERRAggregation_Boolean
from the Function list. This expression function sets the variableoutput
to a scalar value of the TERR data typelogical
(TRUE
orFALSE
), which Spotfire converts to the corresponding Spotfire data type Boolean. The TERR script is called once for each group of data to be aggregated. No special handling for aggregation is necessary in your TERR script. - TERRAggregation_DateTime
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERRAggregation_DateTime
from the Function list. This expression function sets the variableoutput
to a scalar value of the TERR data typePOSIXct
orPOSIXlt
, which Spotfire converts to the corresponding Spotfire data type DateTime. The TERR script is called once for each group of data to be aggregated. No special handling for aggregation is necessary in your TERR script. - TERRAggregation_Integer
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERRAggregation_Integer
from the Function list. This expression function sets the variableoutput
to a scalar value of the TERR data typeinteger
, which Spotfire converts to the corresponding Spotfire data type Integer. The TERR script is called once for each group of data to be aggregated. No special handling for aggregation is necessary in your TERR script. - TERRAggregation_Real
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERRAggregation_Real
from the Function list. This expression function sets the variableoutput
to a scalar value of the TERR data typenumeric
, which Spotfire converts to the corresponding Spotfire data type Real. The TERR script is called once for each group of data to be aggregated. No special handling for aggregation is necessary in your TERR script. - TERRAggregation_String
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERRAggregation_String
from the Function list. This expression function sets the variableoutput
to a scalar value of the TERR data typecharacter
, which Spotfire converts to the corresponding Spotfire data type String. The TERR script is called once for each group of data to be aggregated. No special handling for aggregation is necessary in your TERR script. - TERRAggregation_TimeSpan
In the Spotfire Custom Expressions dialog box, you can select the pre-defined expressionTERRAggregation_TimeSpan
from the Function list. This expression function sets the variableoutput
to a scalar value of the TERR data typedifftime
, which Spotfire converts to the corresponding Spotfire data type TimeSpan. The TERR script is called once for each group of data to be aggregated. No special handling for aggregation is necessary in your TERR script.