Data Functions
You can write data functions in R, S-PLUS, SAS, or MATLAB to perform statistical analyses and display the results in Spotfire.
- Registering a Data Function in Spotfire
A data function is an embedded TERR script that you can save to the library and share with others. Spotfire Analyst includes several out-of-the-box data functions that you can study, edit and save, or run in example data sets. You can use this example task to learn to register a simple data function using a data set provided in the help. - Importing TERR Data Sets Using a Data Function
Several sample data sets are included in this help as HTML tables that you can copy and paste into Spotfire, but you can also write a data function to import data sets available in the TERR library Sdatasets. - Testing Data Functions Inside and Outside of Spotfire
When you test a data function, to make sure you get consistent results in both the TERR engine in RStudio and the TERR engine in Spotfire, use the same data format and the same TERR engine in both environments. - Enabling Debugging for Data Functions
In Spotfire Analyst, set the option to debug data function. - Building a Spotfire Control to Check the Debugging Option
You can create a data function that uses the Spotfire debugging flag to check if data function debugging is enabled, and then use a Spotfire control to report the status of the debugging option. - Debug a Simple Data Function
When you write a TERR data function to add to your Spotfire analysis, you can use the built-in debugging feature in Spotfire Analyst to examine the output debugging log, and you can find and fix problems with the data function directly from within the Spotfire Analyst environment.
- Registering a Data Function in Spotfire
A data function is an embedded TERR script that you can save to the library and share with others. Spotfire Analyst includes several out-of-the-box data functions that you can study, edit and save, or run in example data sets. You can use this example task to learn to register a simple data function using a data set provided in the help. - Importing TERR Data Sets Using a Data Function
Several sample data sets are included in this help as HTML tables that you can copy and paste into Spotfire, but you can also write a data function to import data sets available in the TERR library Sdatasets. - Testing Data Functions Inside and Outside of Spotfire
When you test a data function, to make sure you get consistent results in both the TERR engine in RStudio and the TERR engine in Spotfire, use the same data format and the same TERR engine in both environments. - Enabling Debugging for Data Functions
In Spotfire Analyst, set the option to debug data function. - Building a Spotfire Control to Check the Debugging Option
You can create a data function that uses the Spotfire debugging flag to check if data function debugging is enabled, and then use a Spotfire control to report the status of the debugging option. - Debug a Simple Data Function
When you write a TERR data function to add to your Spotfire analysis, you can use the built-in debugging feature in Spotfire Analyst to examine the output debugging log, and you can find and fix problems with the data function directly from within the Spotfire Analyst environment.
Parent topic: Using TERR for Advanced Analytics in Spotfire
Related concepts
Related reference