In all supported versions of the Spotfire Analyst desktop client (Spotfire 7.0 and later), the following selection from the main menu will open a TERR Console session using the Spotfire desktop client's built-in TERR engine (with the same optional R packages installed as are available for the data function's use):
Tools > TERR Tools > Launch TERR Console
To make your Spotfire data function's input data table(s) available for use in the TERR Console session, you can export each data table to a Spotfire Binary Data Format (SBDF) file, then import the data into your TERR Console session at the beginning of your test script.
For example, if my laptop has a "C:\data" folder and my Spotfire data function uses a data table named "TestData" as an input parameter, I can select the following sequence from the main menu, and browse to the "C:\data" folder to save the data table in an SBDF file named "TestData.sbdf":
File > Export > Data to File > Data Table > All rows > OK > Save as type "TIBCO Spotfire Binary Data Format (*.sbdf)"
Then I can use the following command to import the data into my TERR Console session for use in testing commands from the data function's TERR script:
TestData <- SpotfireData::importDataFromSBDF( "c:/data/TestData.sbdf" )
Note that R and TERR use the slash ("/") as a path separator, even on Windows. A single backslash ("\") will not work.