TCP-SP practice question 4 of 15

Which two of the following are ways to use R scripts in custom expressions? Choose 2 answers

Full set: 60 questions

Domain StreamBase Expression Language

Answer options
A: Register R scripts as data functions
B: In a property control
C: In an action control's actions
D: in an axis 'n a visualization Correct answer
E: Using the TERR_string() and related functions Correct answer
Correct Answer:
D. in an axis 'n a visualization; E. Using the TERR_string() and related functions
Explanation

TIBCO Spotfire provides a specific set of functions to embed and execute TIBCO Enterprise Runtime for R (TERR) scripts directly within its expression language. These functions are TERRReal(), TERRInteger(), TERRString(), and TERRBoolean(). They allow for row-by-row data processing by passing column values as inputs to the embedded R script. A primary application for these custom expressions is on the axes of visualizations. This enables dynamic, on-the-fly calculations using the power of R without the need to pre-calculate a new column or run a separate data function. For example, an expression like TERRReal("output <- log(input1)", [Sales]) could be used directly on a visualization's value axis.

Why Incorrect

A. Register R scripts as data functions: Data functions are a separate, powerful mechanism for executing R scripts, but they are not used within a custom expression. They are registered objects that run independently.
B. In a property control: A property control is a user interface element (e.g., a slider, drop-down) used to modify a document property's value, not to execute an R script.
C. In an action control's actions: An action control (e.g., a button) can be configured to trigger a data function, but this is an event-based execution, not an inline evaluation within a custom expression.

References

1. TIBCO Spotfire® Analyst 12.0 LTS User's Guide

"Statistical Functions"

Page 429. The guide lists and describes the TERRBoolean

TERRInteger

TERRReal

and TERRString functions. It explicitly states

"You can use these functions when you create a calculated column

or you can use them on a visualization axis." This directly supports options D and E.

2. TIBCO® Enterprise Runtime for R - A TIBCO® Data Science Component Version 1.7

"Using TERR in TIBCO Spotfire®"

Section: "TERR in Spotfire expressions"

Page 11. This document details the usage of TERR functions and provides examples. It clarifies that "You can use these functions anywhere you can use Spotfire's expression language

such as in calculated columns or on visualization axes." This confirms that using these functions (Option E) on an axis (Option D) are correct methods.

3. TIBCO Spotfire® Analyst 12.0 LTS User's Guide

"What are Data Functions?"

Page 503. This section describes data functions as a method to "pass data to a statistical engine... and bring back the results

" which is a distinct process from embedding scripts in expressions. This confirms why option A is incorrect.

Scroll to Top